Conversation
|
Also, everything probably needs to be in by-name instead. Also, you probably want to split the two packages into their own files. |
|
@ethancedwards8 Suggestions applied.
What about |
Not sure. good question. Probably best to leave it for someone more experienced than me to comment |
|
Suggestions applied. I've moved the package to |
50058bd to
5091d8e
Compare
|
@ethancedwards8 @wegank conflicts resolved |
Signed-off-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: Sebaguardian <sebaguardian13@gmail.com> Signed-off-by: Adam Perkowski <adas1per@protonmail.com>
|
|
|
Would suggest to change as below.
diff --git a/pkgs/by-name/ju/julec/package.nix b/pkgs/by-name/ju/julec/package.nix
index 50007c3a5f97..68457a72960a 100644
--- a/pkgs/by-name/ju/julec/package.nix
+++ b/pkgs/by-name/ju/julec/package.nix
@@ -2,7 +2,6 @@
lib,
stdenv,
fetchFromGitHub,
- clang,
}:
let
@@ -18,7 +17,7 @@ let
else if stdenv.hostPlatform.system == "aarch64-darwin" then
"darwin-arm64.cpp"
else
- abort "Unsupported platform: ${stdenv.hostPlatform.system}";
+ throw "Unsupported platform: ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation (finalAttrs: {
pname = "julec";
@@ -35,13 +34,13 @@ stdenv.mkDerivation (finalAttrs: {
irSrc = fetchFromGitHub {
owner = "julelang";
repo = "julec-ir";
+ # revision determined by: ?
rev = "a274782922e4275c4a036d63acffd3369dbc382f";
name = "jule-ir-${finalAttrs.version}";
hash = "sha256-TXMSXTGTzZntPUhT6QTmn3nD2k855ZoAW9aQWyhrE8s=";
};
dontConfigure = true;
- buildInputs = [ clang ];
unpackPhase = ''
runHook preUnpack
@@ -61,14 +60,14 @@ stdenv.mkDerivation (finalAttrs: {
echo "Building ${finalAttrs.pname} v${finalAttrs.version} for ${stdenv.hostPlatform.system}..."
mkdir -p bin
- clang++ ir.cpp \
+ ${stdenv.cc.targetPrefix}c++ ir.cpp \
--std=c++17 \
-Wno-everything \
-O3 \
-flto \
-DNDEBUG \
-fomit-frame-pointer \
- -o "bin/${finalAttrs.pname}"
+ -o "bin/${finalAttrs.meta.mainProgram}"
runHook postBuild
'';
@@ -81,13 +80,13 @@ stdenv.mkDerivation (finalAttrs: {
cp -R api $out/lib/jule/api
cp -R std $out/lib/jule/std
cp -R bin $out/lib/jule/bin
- ln -s $out/lib/jule/bin/${finalAttrs.pname} $out/bin/${finalAttrs.pname}
+ ln -s $out/lib/jule/bin/${finalAttrs.meta.mainProgram} $out/bin/${finalAttrs.meta.mainProgram}
runHook postInstall
'';
meta = {
- description = "The Jule Programming Language Compiler";
+ description = "Jule Programming Language Compiler";
longDescription = ''
Jule is an effective programming language designed to build efficient, fast, reliable and safe software while maintaining simplicity.
It is a statically typed, compiled language with a syntax influenced by Go, Rust, and C++.
@@ -95,7 +94,13 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://jule.dev";
changelog = "https://github.com/julelang/manual/releases/tag/jule${finalAttrs.version}";
license = lib.licenses.bsd3;
- platforms = lib.platforms.unix;
+ platforms = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "i686-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
mainProgram = "julec";
maintainers = with lib.maintainers; [
adamperkowski |
Co-authored-by: Sebaguardian <sebaguardian13@gmail.com> Co-authored-by: FliegendeWurst <arne.keller@posteo.de> Signed-off-by: Adam Perkowski <adas1per@protonmail.com>
|
@FliegendeWurst thanks, applied :) |
|
Since |
Yes, that'd be the case for implementations like julec-git for example but since |
philiptaron
left a comment
There was a problem hiding this comment.
If it's going to be bit-for-bit equivalent, that'd make an excellent test for future updates.
Maybe put it in passthru.tests.recompile-equivalence.
I built this a lot of different ways (julec, pkgsLLVM.julec, pkgsStatic.julec, pkgsCross.aarch64-multiplatform.julec) and it all compiled, though the errors the C++ compiler emitted made me think that some of the codegen might not be tuned appropriately. Not a concern when introducing a new compiler package though.
Good idea. Unfortunately, it's not. If I had to guess it's due to the use of unsorted maps in IR generation. The Arch AUR packages use basic std tests transpiling for testing. This could be implemented here as well, although it doesn't really test much. Also, |
Jule is a general-purpose programming language focusing on systems programming. It aims to be fast, efficient and safe. Jule has its own set of goals and ideas that make it original.
Website: jule.dev
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.