mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
Merge pull request #324380 from znaniye/odin-07
odin: dev-2024-06 -> dev-2024-07
This commit is contained in:
commit
015ea99aea
98
pkgs/by-name/od/odin/package.nix
Normal file
98
pkgs/by-name/od/odin/package.nix
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
fetchFromGitHub,
|
||||||
|
lib,
|
||||||
|
libiconv,
|
||||||
|
llvmPackages,
|
||||||
|
MacOSX-SDK,
|
||||||
|
makeBinaryWrapper,
|
||||||
|
nix-update-script,
|
||||||
|
Security,
|
||||||
|
which,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (llvmPackages) stdenv;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "odin";
|
||||||
|
version = "dev-2024-07";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "odin-lang";
|
||||||
|
repo = "Odin";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-FeiVTLwgP0x1EZqqiYkGbKALhZWC4xE6a/3PPcEElAc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch =
|
||||||
|
lib.optionalString stdenv.isDarwin ''
|
||||||
|
substituteInPlace src/linker.cpp \
|
||||||
|
--replace-fail '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' ${MacOSX-SDK}
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
|
substituteInPlace build_odin.sh \
|
||||||
|
--replace-fail '-framework System' '-lSystem'
|
||||||
|
patchShebangs build_odin.sh
|
||||||
|
'';
|
||||||
|
|
||||||
|
LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config";
|
||||||
|
|
||||||
|
dontConfigure = true;
|
||||||
|
|
||||||
|
buildFlags = [ "release" ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeBinaryWrapper
|
||||||
|
which
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = lib.optionals stdenv.isDarwin [
|
||||||
|
libiconv
|
||||||
|
Security
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp odin $out/bin/odin
|
||||||
|
|
||||||
|
mkdir -p $out/share
|
||||||
|
cp -r base $out/share/base
|
||||||
|
cp -r core $out/share/core
|
||||||
|
cp -r vendor $out/share/vendor
|
||||||
|
|
||||||
|
wrapProgram $out/bin/odin \
|
||||||
|
--prefix PATH : ${
|
||||||
|
lib.makeBinPath (
|
||||||
|
with llvmPackages;
|
||||||
|
[
|
||||||
|
bintools
|
||||||
|
llvm
|
||||||
|
clang
|
||||||
|
lld
|
||||||
|
]
|
||||||
|
)
|
||||||
|
} \
|
||||||
|
--set-default ODIN_ROOT $out/share
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script { };
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Fast, concise, readable, pragmatic and open sourced programming language";
|
||||||
|
downloadPage = "https://github.com/odin-lang/Odin";
|
||||||
|
homepage = "https://odin-lang.org/";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
mainProgram = "odin";
|
||||||
|
maintainers = with lib.maintainers; [
|
||||||
|
astavie
|
||||||
|
luc65r
|
||||||
|
znaniye
|
||||||
|
];
|
||||||
|
platforms = lib.platforms.unix;
|
||||||
|
broken = stdenv.hostPlatform.isMusl;
|
||||||
|
};
|
||||||
|
}
|
@ -1,81 +0,0 @@
|
|||||||
{ lib
|
|
||||||
, fetchFromGitHub
|
|
||||||
, llvmPackages
|
|
||||||
, makeBinaryWrapper
|
|
||||||
, libiconv
|
|
||||||
, MacOSX-SDK
|
|
||||||
, Security
|
|
||||||
, which
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (llvmPackages) stdenv;
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "odin";
|
|
||||||
version = "dev-2024-06";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "odin-lang";
|
|
||||||
repo = "Odin";
|
|
||||||
rev = version;
|
|
||||||
hash = "sha256-Ba+244L855y+XzLcaf1fgQhHVDv2Q77GPapRAYmCQfg=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
makeBinaryWrapper which
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isDarwin [
|
|
||||||
libiconv
|
|
||||||
Security
|
|
||||||
];
|
|
||||||
|
|
||||||
LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config";
|
|
||||||
|
|
||||||
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
||||||
substituteInPlace src/linker.cpp \
|
|
||||||
--replace-fail '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' ${MacOSX-SDK}
|
|
||||||
'' + ''
|
|
||||||
substituteInPlace build_odin.sh \
|
|
||||||
--replace-fail '-framework System' '-lSystem'
|
|
||||||
patchShebangs build_odin.sh
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontConfigure = true;
|
|
||||||
|
|
||||||
buildFlags = [
|
|
||||||
"release"
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp odin $out/bin/odin
|
|
||||||
|
|
||||||
mkdir -p $out/share
|
|
||||||
cp -r base $out/share/base
|
|
||||||
cp -r core $out/share/core
|
|
||||||
cp -r vendor $out/share/vendor
|
|
||||||
|
|
||||||
wrapProgram $out/bin/odin \
|
|
||||||
--prefix PATH : ${lib.makeBinPath (with llvmPackages; [
|
|
||||||
bintools
|
|
||||||
llvm
|
|
||||||
clang
|
|
||||||
lld
|
|
||||||
])} \
|
|
||||||
--set-default ODIN_ROOT $out/share
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Fast, concise, readable, pragmatic and open sourced programming language";
|
|
||||||
mainProgram = "odin";
|
|
||||||
homepage = "https://odin-lang.org/";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
maintainers = with maintainers; [ luc65r astavie znaniye ];
|
|
||||||
platforms = platforms.x86_64 ++ [ "aarch64-darwin" ];
|
|
||||||
};
|
|
||||||
}
|
|
@ -27445,7 +27445,7 @@ with pkgs;
|
|||||||
|
|
||||||
octomap = callPackage ../development/libraries/octomap { };
|
octomap = callPackage ../development/libraries/octomap { };
|
||||||
|
|
||||||
odin = callPackage ../development/compilers/odin {
|
odin = callPackage ../by-name/od/odin/package.nix {
|
||||||
inherit (pkgs.darwin.apple_sdk_11_0) MacOSX-SDK;
|
inherit (pkgs.darwin.apple_sdk_11_0) MacOSX-SDK;
|
||||||
inherit (pkgs.darwin.apple_sdk_11_0.frameworks) Security;
|
inherit (pkgs.darwin.apple_sdk_11_0.frameworks) Security;
|
||||||
llvmPackages = llvmPackages_18;
|
llvmPackages = llvmPackages_18;
|
||||||
|
Loading…
Reference in New Issue
Block a user