Files
nixpkgs/pkgs/by-name/mo/mozart-binary/package.nix
Guy Chronister b9a2920c0e mozart2{,-binary}: migrate to pkgs/by-name
- Move mozart2 to pkgs/by-name/mo/mozart2/package.nix
- Move mozart-binary to pkgs/by-name/mo/mozart-binary/package.nix
- Relocate patch-limits.diff alongside mozart2
- Remove mozart2 and mozart2-binary from all-packages.nix
- No functional changes; structural migration only
2026-07-19 10:28:13 -05:00

93 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchurl,
makeWrapper,
boost,
gmp,
tcl-8_5,
tk-8_5,
emacs,
}:
stdenv.mkDerivation (
finalAttrs:
let
binaries = {
x86_64-linux = fetchurl {
url = "mirror://sourceforge/project/mozart-oz/v${finalAttrs.version}-alpha.0/mozart2-${finalAttrs.version}-alpha.0+build.4105.5c06ced-x86_64-linux.tar.gz";
hash = "sha256-v0D/TlNe9tajFAWsicvjUY0/aPOV/n/z5Qt3WaPMTmc=";
};
};
in
{
pname = "mozart-binary";
version = "2.0.0";
preferLocalBuild = true;
src =
binaries.${stdenv.hostPlatform.system}
or (throw "unsupported system: ${stdenv.hostPlatform.system}");
strictDeps = true;
__structuredAttrs = true;
libPath = lib.makeLibraryPath [
stdenv.cc.cc
boost
gmp
tcl-8_5
tk-8_5
];
env.TK_LIBRARY = "${tk-8_5}/lib/tk8.5";
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir $out
tar xvf $src -C $out --strip-components=1
for exe in $out/bin/{ozemulator,ozwish} ; do
patchelf --set-interpreter $(< $NIX_CC/nix-support/dynamic-linker) \
--set-rpath $libPath \
$exe
done
wrapProgram $out/bin/ozwish \
--set OZHOME $out \
--set TK_LIBRARY $TK_LIBRARY
wrapProgram $out/bin/ozemulator --set OZHOME $out
${lib.optionalString (emacs != null) ''
wrapProgram $out/bin/oz --suffix PATH ":" ${lib.makeBinPath [ emacs ]}
''}
sed -i $out/share/applications/oz.desktop \
-e "s,Exec=oz %u,Exec=$out/bin/oz %u,"
gzip -9n $out/share/mozart/elisp"/"*.elc
patchShebangs $out
'';
meta = {
homepage = "https://www.mozart-oz.org/";
description = "Multiplatform implementation of the Oz programming language";
longDescription = ''
The Mozart Programming System combines ongoing research in
programming language design and implementation, constraint logic
programming, distributed computing, and human-computer
interfaces. Mozart implements the Oz language and provides both
expressive power and advanced functionality.
'';
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.mit;
platforms = lib.attrNames binaries;
hydraPlatforms = [ ];
};
}
)