1{ language, buildInputs ? [ ], binaries ? [ ], setFlags ? false
4{ lib, buildGoModule, fetchFromGitHub, bash, expect, pkg-config, runCommand, git
5, python3, copyPathToStore, rev, makeWrapper }:
8 pname = "prybar-${language}";
14 nativeBuildInputs = [ pkg-config makeWrapper ];
16 subPackages = [ "languages/${language}" ];
18 vendorSha256 = "1nrycpyjmmhs8cl6bmrajfwczxsv8z20y7a9k7js8p7z60fz7pya";
20 # This prebiuild hook will setup the compiler flags on demand based on the package
21 # If a language requires this, it MUST expost a ${pkgName}.pc file in its `lib/pkg-config`
22 # for pkg-config to detect it. Otherwise, we can't find the required flags.
24 export CGO_LDFLAGS_ALLOW="-Wl,--compress-debug-sections=zlib"
26 export NIX_CFLAGS_COMPILE="$(pkg-config --cflags ${pkgName}) $NIX_CFLAGS_COMPILE"
27 export NIX_LDFLAGS="$(pkg-config --libs-only-L ${pkgName}) $(pkg-config --libs-only-l ${pkgName}) $NIX_LDFLAGS"
31 ${bash}/bin/bash ./scripts/inject.sh ${language}
32 go generate ./languages/${language}/main.go
34 if [[ -f "languages/${language}/compile" ]]; then
35 patchShebangs languages/${language}/compile
36 languages/${language}/compile;
40 # The test file expect the binary to be in the current directory rather than bin
42 cp $GOPATH/bin/${language} ./prybar-${language}
45 # Add all the dependencies to the check. Binaries should include the language interpreter/binaries
46 # for testing the language.
47 checkInputs = [ expect ] ++ buildInputs ++ binaries;
49 # Run the end-to-end tests for this specific language
53 # Nix unsets HOME but some tests rely on it, let's set it to whatever tmp dir the check
55 export HOME=$(echo pwd)
57 # Currently the go tests won't work in nix because of something w/ nix's sandboxing.
59 DISABLE_GO_TESTS=1 "${bash}/bin/bash" "./run_tests_language" "${language}"
64 # Delete the test binary we copied in the preCheck
66 rm -f ./prybar-${language}
70 mv $out/bin/${language} $out/bin/prybar-${language}
72 if [ -d "./prybar_assets/${language}" ]
74 mkdir -p "$out/prybar_assets/${language}"
75 cp -R "./prybar_assets/${language}" "$out/prybar_assets/"
77 wrapProgram "$out/bin/prybar-${language}" \
78 --set PRYBAR_ASSETS_DIR "$out/prybar_assets"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list