shiru: add darwin support (#534728)
This commit is contained in:
@@ -65,7 +65,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
./node_modules/.bin/electron-builder --dir \
|
||||
--c.electronDist=electron-dist \
|
||||
--c.electronVersion=${electron.version}
|
||||
--c.electronVersion=${electron.version} \
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
--c.npmRebuild=false \
|
||||
--c.mac.identity=null \
|
||||
--c.mac.notarize=false \
|
||||
''}
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
@@ -73,6 +78,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
''
|
||||
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
||||
mkdir -p "$out/share/lib/shiru"
|
||||
cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/shiru"
|
||||
|
||||
@@ -82,7 +89,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--add-flags "$out/share/lib/shiru/resources/app.asar" \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}" \
|
||||
--inherit-argv0
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir -p "$out/Applications"
|
||||
cp -r dist/mac*/Shiru.app "$out/Applications/"
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
makeWrapper \
|
||||
"$out/Applications/Shiru.app/Contents/MacOS/Shiru" \
|
||||
"$out/bin/shiru" \
|
||||
--set-default ELECTRON_IS_DEV 0
|
||||
''
|
||||
+ ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@@ -116,7 +134,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
maintainers = with lib.maintainers; [
|
||||
naomieow
|
||||
];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
mainProgram = "shiru";
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user