-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54454 from teto/luarocks_fixes
luarocks: support more commands: pack/build
- Loading branch information
Showing
5 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ luarocks, fetchFromGitHub }: | ||
luarocks.overrideAttrs(old: { | ||
src = fetchFromGitHub { | ||
owner = "teto"; | ||
repo = "luarocks"; | ||
rev = "d669e8e118e6ca8bff05f32dbc9e5589e6ac45d2"; | ||
sha256 = "1lay3905a5sx2a4y68lbys0913qs210hcj9kn2lbqinw86c1vyc3"; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
unpackCmdHooks+=(_trySourceRock) | ||
unpackCmdHooks+=(_tryRockSpec) | ||
|
||
_tryRockSpec() { | ||
if ! [[ "$curSrc" =~ \.rockspec$ ]]; then return 1; fi | ||
} | ||
|
||
_trySourceRock() { | ||
|
||
if ! [[ "$curSrc" =~ \.src.rock$ ]]; then return 1; fi | ||
|
||
export PATH=${unzip}/bin:$PATH | ||
|
||
# luarocks expects a clean <name>.rock.spec name to be the package name | ||
# so we have to strip the hash | ||
renamed="$(stripHash $curSrc)" | ||
cp "$curSrc" "$renamed" | ||
luarocks unpack --force "$renamed" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters