🐰 xiaoxiangmoe | * Here is my pkg definition
{
buildGoModule,
fetchFromGitHub,
lib,
nix-update-script,
}:
buildGoModule rec {
pname = "lipo-go";
version = "0.9.3";
src = fetchFromGitHub {
owner = "konoui";
repo = "lipo";
rev = "b7b34565565e3cde8037d1b5ee95dd2bb3579ef1";
# tag = "v${version}";
hash = "sha256-mDx1kQ5FzM4b/1LWccRbaGAt68ez4Bs+7N04aQUUaQg=";
};
env = {
GIT_VERSION = version;
GIT_REVISION = "b7b34565565e3cde8037d1b5ee95dd2bb3579ef1";
};
passthru.updateScript = nix-update-script { };
vendorHash = "sha256-7M6CRxJd4fgYQLJDkNa3ds3f7jOp3dyloOZtwMtCBQk=";
postPatch = ''
# remove the test that requires access permit to /bin
sed -i '/bin := filepath.Join/a info, err := os.Stat(bin);if err != nil || info.Mode().Perm()&0444 != 0444 { continue }' pkg/lipo/archs_test.go
'';
buildPhase = ''
make build VERSION=$GIT_VERSION REVISION=$GIT_REVISION BINARY=$out/bin/lipo
'';
meta = {
description = "This lipo is designed to be compatible with macOS lipo, written in golang.";
homepage = "https://github.com/konoui/lipo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
};
}
| 16:03:07 |
🐰 xiaoxiangmoe | I found a workaround for this
{
buildGoModule,
fetchFromGitHub,
lib,
nix-update-script,
}:
buildGoModule rec {
pname = "lipo-go";
version = "0.9.3";
src = fetchFromGitHub {
owner = "konoui";
repo = "lipo";
rev = "refs/tags/v${version}";
hash = "sha256-lZgOoN+oibo2h6bw5KHXuiwQvQecTQiqu400sGfaMi0=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse --short HEAD > "$out/CI_COMMIT_SHORT_SHA"
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
passthru.updateScript = nix-update-script { };
vendorHash = "sha256-7M6CRxJd4fgYQLJDkNa3ds3f7jOp3dyloOZtwMtCBQk=";
postPatch = ''
# remove the test that requires access permit to /bin
sed -i '/bin := filepath.Join/a info, err := os.Stat(bin);if err != nil || info.Mode().Perm()&0444 != 0444 { continue }' pkg/lipo/archs_test.go
'';
buildPhase = ''
make build VERSION=${version} REVISION=$(<CI_COMMIT_SHORT_SHA) BINARY=$out/bin/lipo
'';
meta = {
description = "This lipo is designed to be compatible with macOS lipo, written in golang.";
homepage = "https://github.com/konoui/lipo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
};
}
| 18:33:14 |