add nix package
This commit is contained in:
parent
b407bbfdee
commit
11ecec5ab3
5 changed files with 65 additions and 23 deletions
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
lib,
|
||||
callPackage,
|
||||
libclang,
|
||||
flutter,
|
||||
src,
|
||||
go,
|
||||
}:
|
||||
|
||||
flutter.buildFlutterApplication {
|
||||
|
|
@ -12,16 +12,13 @@ flutter.buildFlutterApplication {
|
|||
inherit src;
|
||||
|
||||
preBuild = ''
|
||||
cp ${callPackage ./gomuks.nix { inherit src; }}/lib/* .
|
||||
packageRunCustom nexus generate source/scripts test
|
||||
packageRun build_runner build
|
||||
'';
|
||||
|
||||
env.LIBCLANG_PATH = lib.makeLibraryPath [ libclang ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
go
|
||||
];
|
||||
|
||||
autoPubspecLock = src + "/pubspec.lock";
|
||||
|
||||
gitHashes = {
|
||||
31
linux/nix/pkg/gomuks.nix
Normal file
31
linux/nix/pkg/gomuks.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
src,
|
||||
buildGoModule,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "gomuks-ffi";
|
||||
version = "submodule";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
src = "${src}/gomuks";
|
||||
|
||||
vendorHash = "sha256-zBDfBZqUoHIfZ0AajZEvSBbskjpFB7yIsomt0KYDo7Y=";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
go build -buildmode=c-shared -o libgomuks.so -tags goolm,noheic ./pkg/ffi
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D --mode=0644 libgomuks.so --target-directory $out/lib
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue