Closed 573 closed 2 years ago
This is about this line: https://github.com/ArthurSonzogni/Diagon/blob/master/tools/download_and_patch.sh#L8
I see this error:
Warning: Failed to create the file antlr.jar: Permission denied
Do you know why the permission to create a file is denied? Are you owning the current directory?
Inside "Diagon/tools", what is the output of:
ls -lart
?
-rw-r--r-- 1 me users 1336 May 4 09:49 cmake_install.cmake -rw-r--r-- 1 me users 7837 May 4 14:50 Makefile drwxr-xr-x 7 me users 4096 May 4 15:00 build drwxr-xr-x 4 me users 4096 May 4 15:15 . drwxr-xr-x 2 me users 4096 May 4 15:15 CMakeFiles drwxr-xr-x 8 me users 4096 May 4 15:16 ..
I'll have to recheck later what the real permissions are as I download the sources while building. For now thanks for your input, I'll be back with progress.
It is very roughly this, I can build using nix-build
now:
# file default.nix
{ pkgs ? import <nixpkgs> {}, ... }:
pkgs.stdenv.mkDerivation {
name = "env";
src = pkgs.lib.cleanSource (builtins.fetchTarball https://github.com/ArthurSonzogni/Diagon/tarball/master);
nativeBuildInputs = with pkgs; [ cmake pkgconfig git cacert (jre_minimal.override { jdk = jdk11_headless; }) ant extra-cmake-modules ];
buildInputs = with pkgs; [ boost libuuid.dev icu ];
# the https://github.com/ArthurSonzogni/Diagon/blob/master/tools/download_and_patch.sh should not be needed
# bc we have antlr already in the inputs
# Also https://github.com/ArthurSonzogni/Diagon/blob/34b68f63e45f6912e18682e797b31b43c5ac05c8/tools/CMakeLists.txt#L6
# ..
# https://github.com/ArthurSonzogni/Diagon/blob/34b68f63e45f6912e18682e797b31b43c5ac05c8/tools/CMakeLists.txt#L9
# can be patched off
# Also https://github.com/ArthurSonzogni/Diagon/blob/34b68f63e45f6912e18682e797b31b43c5ac05c8/tools/CMakeLists.txt#L36
# can be patched replacing by
# -jar ${pkgs.antlr.jarLocation}
prePatch = "ls -lart tools";
patches = [
./patch_cmakelists
];
postPatch = ''
substituteInPlace tools/CMakeLists.txt \
--replace '-jar ''${DIAGON_TOOLS_DIR}/antlr.jar' '-jar ${pkgs.antlr.jarLocation}'
'';
propagatedBuildInputs = with pkgs; [ antlr ];
}
file ./patch_cmakelists
being:
--- a/tools/CMakeLists.txt 2022-05-05 12:24:44.073703300 +0200
+++ b/tools/CMakeLists2.txt 2022-05-05 12:28:45.463703300 +0200
@@ -3,10 +3,6 @@
# ┌─────────────────────────────────────────────────┐
# │ ANTLR │
# └─────────────────────────────────────────────────┘
-execute_process(
- COMMAND bash download_and_patch.sh
- WORKING_DIRECTORY ${DIAGON_TOOLS_DIR}
-)
# Function
# ANTLR(<file.g4>)
I find this a wonderful project, thanks for making it.
When trying to package for NixOS I found that my build stuck at locating the antlr.jar:
I'm pretty much a beginner coming to cmake or even nix, maybe you have a clue and can give a nudge here ?
This my default.nix for the build so far:
Also I'm getting
when running the
eval cmake $cmakeFlags -Wno-dev -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON $src