formula: simplify postFixup

This commit is contained in:
GGG 2024-12-19 14:42:55 -03:00 committed by Weijia Wang
parent 6cd4d4a971
commit 38a5cfb2fb
2 changed files with 12 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{
lib,
stdenv,
stdenvNoCC,
fetchFromGitHub,
buildDotnetModule,
dotnetCorePackages,
@ -25,16 +25,14 @@ buildDotnetModule (finalAttrs: {
projectFile = "Src/CommandLine/CommandLine.csproj";
postFixup =
if stdenv.hostPlatform.isLinux then
''
mv $out/bin/CommandLine $out/bin/formula
''
else
lib.optionalString stdenv.hostPlatform.isDarwin ''
makeWrapper ${dotnetCorePackages.runtime_8_0}/bin/dotnet $out/bin/formula \
--add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
--prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native
'';
lib.optionalString stdenvNoCC.isLinux ''
mv $out/bin/CommandLine $out/bin/formula
''
+ lib.optionalString stdenvNoCC.isDarwin ''
makeWrapper ${dotnetCorePackages.runtime_8_0}/bin/dotnet $out/bin/formula \
--add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
--prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native
'';
passthru.updateScript = unstableGitUpdater { url = finalAttrs.meta.homepage; };

View File

@ -1,6 +1,6 @@
{
lib,
stdenv,
stdenvNoCC,
fetchFromGitHub,
buildDotnetModule,
dotnetCorePackages,
@ -23,13 +23,13 @@ buildDotnetModule (finalAttrs: rec {
[
powershell
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
++ lib.optionals (stdenvNoCC.hostPlatform.isDarwin && stdenvNoCC.hostPlatform.isAarch64) [
autoSignDarwinBinariesHook
];
# https://github.com/NixOS/nixpkgs/issues/38991
# bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
env.LOCALE_ARCHIVE = lib.optionalString stdenv.hostPlatform.isLinux "${glibcLocales}/lib/locale/locale-archive";
env.LOCALE_ARCHIVE = lib.optionalString stdenvNoCC.hostPlatform.isLinux "${glibcLocales}/lib/locale/locale-archive";
dotnet-sdk = dotnetCorePackages.sdk_8_0;