push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
wrapQtAppsHook,
glm,
eigen,
qtbase,
stellarium,
}:
stdenv.mkDerivation rec {
pname = "calcmysky";
version = "0.3.5";
src = fetchFromGitHub {
owner = "10110111";
repo = "CalcMySky";
tag = "v${version}";
hash = "sha256-++011c4/IFf/5GKmFostTnxgfEdw3/GJf0e5frscCQ4=";
};
nativeBuildInputs = [
cmake
wrapQtAppsHook
];
buildInputs = [
glm
eigen
qtbase
];
cmakeFlags = [ "-DQT_VERSION=6" ];
doCheck = true;
passthru.tests = {
inherit stellarium;
};
meta = with lib; {
description = "Simulator of light scattering by planetary atmospheres";
homepage = "https://github.com/10110111/CalcMySky";
license = licenses.gpl3Only;
maintainers = with maintainers; [ nickcao ];
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch2,
pkg-config,
libglut,
gtk2,
gtkglext,
libjpeg_turbo,
libtheora,
libXmu,
lua,
libGLU,
libGL,
perl,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "celestia";
version = "1.6.4";
src = fetchFromGitHub {
owner = "CelestiaProject";
repo = "Celestia";
rev = version;
sha256 = "sha256-MkElGo1ZR0ImW/526QlDE1ePd+VOQxwkX7l+0WyZ6Vs=";
};
patches = [
(fetchpatch2 {
url = "https://github.com/CelestiaProject/Celestia/commit/94894bed3bf98d41c5097e7829d491d8ff8d4a62.patch?full_index=1";
hash = "sha256-hEZ6BhSEx6Qm+fLisc63xSCDT6GX92AHD0BuldOhzFk=";
})
];
postPatch = ''
substituteInPlace configure.ac \
--replace-fail "dnl AM_GNU_GETTEXT_VERSION([0.15])" "AM_GNU_GETTEXT_VERSION([0.15])"
'';
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
libglut
gtk2
gtkglext
lua
perl
libjpeg_turbo
libtheora
libXmu
libGLU
libGL
];
configureFlags = [
"--with-gtk"
"--with-lua=${lua}"
];
enableParallelBuilding = true;
meta = {
homepage = "https://celestiaproject.space/";
description = "Real-time 3D simulation of space";
mainProgram = "celestia";
changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
returntoreality
];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,119 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
perl,
wrapGAppsHook3,
wrapQtAppsHook,
qtbase,
qtcharts,
qtpositioning,
qtmultimedia,
qtserialport,
qtwayland,
qtwebengine,
calcmysky,
qxlsx,
indilib,
libnova,
qttools,
exiv2,
nlopt,
testers,
xvfb-run,
gitUpdater,
md4c,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "stellarium";
version = "25.2";
src = fetchFromGitHub {
owner = "Stellarium";
repo = "stellarium";
rev = "v${finalAttrs.version}";
hash = "sha256-2QK9dHflCdmDrRXEHCBpuJR73jsMz9D9lJNa1pbfrTs=";
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace CMakeLists.txt \
--replace-fail 'SET(CMAKE_INSTALL_PREFIX "''${PROJECT_BINARY_DIR}/Stellarium.app/Contents")' \
'SET(CMAKE_INSTALL_PREFIX "${placeholder "out"}/Applications/Stellarium.app/Contents")'
substituteInPlace src/CMakeLists.txt \
--replace-fail "\''${_qt_bin_dir}/../" "${qtmultimedia}/lib/qt-6/"
'';
nativeBuildInputs = [
cmake
perl
wrapGAppsHook3
wrapQtAppsHook
qttools
];
buildInputs = [
qtbase
qtcharts
qtpositioning
qtmultimedia
qtserialport
qtwebengine
calcmysky
qxlsx
indilib
libnova
exiv2
md4c
nlopt
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
];
preConfigure = ''
export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s)
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
export LC_ALL=en_US.UTF-8
'';
# fatal error: 'QtSerialPort/QSerialPortInfo' file not found
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-F${qtserialport}/lib";
dontWrapGApps = true;
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
makeWrapper $out/Applications/Stellarium.app/Contents/MacOS/Stellarium $out/bin/stellarium
'';
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = ''
# Create a temporary home directory because stellarium aborts with an
# error if it can't write some configuration files.
tmpdir=$(mktemp -d)
# stellarium can't be run in headless mode, therefore we need xvfb-run.
HOME="$tmpdir" ${lib.getExe xvfb-run} stellarium --version
'';
};
updateScript = gitUpdater { rev-prefix = "v"; };
};
meta = {
description = "Free open-source planetarium";
mainProgram = "stellarium";
homepage = "https://stellarium.org/";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ kilianar ];
broken = stdenv.hostPlatform.isDarwin;
};
})

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
zlib,
perl,
perlPackages,
openmp,
}:
stdenv.mkDerivation rec {
version = "4.8.1";
pname = "cd-hit";
src = fetchFromGitHub {
owner = "weizhongli";
repo = "cdhit";
rev = "V${version}";
sha256 = "032nva6iiwmw59gjipm1mv0xlcckhxsf45mc2qbnv19lbis0q22i";
};
propagatedBuildInputs = [
perl
perlPackages.TextNSP
perlPackages.ImageMagick
];
nativeBuildInputs = [
zlib
makeWrapper
];
buildInputs = lib.optional stdenv.cc.isClang openmp;
makeFlags = [
"CC=${stdenv.cc.targetPrefix}c++" # remove once https://github.com/weizhongli/cdhit/pull/114 is merged
"PREFIX=$(out)/bin"
];
preInstall = "mkdir -p $out/bin";
postFixup = ''
wrapProgram $out/bin/FET.pl --prefix PERL5LIB : $PERL5LIB
wrapProgram $out/bin/plot_2d.pl --prefix PERL5LIB : $PERL5LIB
wrapProgram $out/bin/clstr_list_sort.pl --prefix PERL5LIB : $PERL5LIB
'';
meta = with lib; {
description = "Clustering and comparing protein or nucleotide sequences";
homepage = "http://weizhongli-lab.org/cd-hit/";
license = licenses.gpl2;
maintainers = [ maintainers.bzizou ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
xxd,
enableMpi ? false,
mpi,
openmp,
}:
stdenv.mkDerivation rec {
pname = "hh-suite";
version = "3.3.0";
src = fetchFromGitHub {
owner = "soedinglab";
repo = "hh-suite";
rev = "v${version}";
hash = "sha256-kjNqJddioCZoh/cZL3YNplweIGopWIGzCYQOnKDqZmw=";
};
patches = [
# Should be removable as soon as this upstream PR is merged: https://github.com/soedinglab/hh-suite/pull/357
(fetchpatch {
name = "fix-gcc13-build-issues.patch";
url = "https://github.com/soedinglab/hh-suite/commit/cec47cba5dcd580e668b1ee507c9282fbdc8e7d7.patch";
hash = "sha256-Msdmj9l8voPYXK0SSwUA6mEbFLBhTjjE/Kjp0VL4Kf4=";
})
];
nativeBuildInputs = [
cmake
xxd
];
cmakeFlags =
lib.optional stdenv.hostPlatform.isx86 "-DHAVE_SSE2=1"
++ lib.optional stdenv.hostPlatform.isAarch "-DHAVE_ARM8=1"
++ lib.optional stdenv.hostPlatform.avx2Support "-DHAVE_AVX2=1"
++ lib.optional stdenv.hostPlatform.sse4_1Support "-DHAVE_SSE4_1=1";
buildInputs = lib.optional stdenv.cc.isClang openmp ++ lib.optional enableMpi mpi;
meta = with lib; {
description = "Remote protein homology detection suite";
homepage = "https://github.com/soedinglab/hh-suite";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ natsukium ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,69 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
makeWrapper,
flex,
bison,
perl,
TextFormat,
libminc,
libjpeg,
nifticlib,
zlib,
}:
stdenv.mkDerivation {
pname = "minc-tools";
version = "2.3.06-unstable-2023-08-12";
src = fetchFromGitHub {
owner = "BIC-MNI";
repo = "minc-tools";
rev = "c86a767dbb63aaa05ee981306fa09f6133bde427";
hash = "sha256-PLNcuDU0ht1PcjloDhrPzpOpE42gbhPP3rfHtP7WnM4=";
};
nativeBuildInputs = [
cmake
flex
bison
makeWrapper
];
buildInputs = [
libminc
libjpeg
nifticlib
zlib
];
propagatedBuildInputs = [
perl
TextFormat
];
cmakeFlags = [
"-DLIBMINC_DIR=${libminc}/lib/cmake"
"-DZNZ_INCLUDE_DIR=${nifticlib}/include/nifti"
"-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti"
];
env.NIX_CFLAGS_COMPILE = "-D_FillValue=NC_FillValue";
postFixup = ''
for prog in minccomplete minchistory mincpik; do
wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB
done
'';
meta = with lib; {
homepage = "https://github.com/BIC-MNI/minc-tools";
description = "Command-line utilities for working with MINC files";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.unix;
license = licenses.free;
broken = stdenv.hostPlatform.isDarwin;
};
}

View File

@@ -0,0 +1,60 @@
{
lib,
stdenv,
fetchFromGitHub,
boost186,
glibc,
}:
let
boost' = boost186.override {
enableShared = false;
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "autodock-vina";
version = "1.2.7";
src = fetchFromGitHub {
owner = "ccsb-scripps";
repo = "autodock-vina";
tag = "v${finalAttrs.version}";
hash = "sha256-AQJl/EUAkdIQJZSN27sbjG7dYbQxeEb8Pd+p2kKRnvA=";
};
sourceRoot = "${finalAttrs.src.name}/build/${
if stdenv.hostPlatform.isDarwin then "mac" else "linux"
}/release";
buildInputs = [
boost'
]
++ lib.optionals stdenv.hostPlatform.isLinux [
glibc.static
];
makeFlags = [
"GPP=${stdenv.cc.targetPrefix}c++"
"BASE=${boost'}"
"BOOST_INCLUDE=${lib.getDev boost'}/include"
];
installPhase = ''
runHook preInstall
install -Dm755 vina vina_split -t $out/bin/
runHook postInstall
'';
passthru.boost = boost';
meta = with lib; {
description = "One of the fastest and most widely used open-source docking engines";
homepage = "https://vina.scripps.edu/";
changelog = "https://github.com/ccsb-scripps/AutoDock-Vina/releases/tag/v${finalAttrs.version}";
license = licenses.asl20;
maintainers = with maintainers; [ natsukium ];
platforms = platforms.unix;
mainProgram = "vina";
};
})

View File

@@ -0,0 +1,65 @@
{
lib,
buildPythonPackage,
autodock-vina,
swig,
setuptools,
numpy,
}:
let
inherit (autodock-vina) boost;
in
buildPythonPackage {
inherit (autodock-vina)
pname
version
src
meta
;
format = "pyproject";
sourceRoot = "${autodock-vina.src.name}/build/python";
postPatch = ''
# wildcards are not allowed
# https://github.com/ccsb-scripps/AutoDock-Vina/issues/176
substituteInPlace setup.py \
--replace "python_requires='>=3.5.*'" "python_requires='>=3.5'"
# setupPyBuildFlags are not applied with `format = "pyproject"`
substituteInPlace setup.py \
--replace "= locate_boost()" "= '${lib.getDev boost}/include', '${boost}/lib'"
# this line attempts to delete the source code
substituteInPlace setup.py \
--replace "shutil.rmtree('src')" "..."
# np.int is deprecated
# https://github.com/ccsb-scripps/AutoDock-Vina/pull/167 and so on
substituteInPlace vina/vina.py \
--replace "np.int" "int"
'';
nativeBuildInputs = [
setuptools
swig
];
buildInputs = [
boost
];
propagatedBuildInputs = [
numpy
];
# upstream has no tests
doCheck = false;
pythonImportsCheck = [
"vina"
];
}

View File

@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
eigen,
avogadrolibs,
molequeue,
hdf5,
openbabel,
qttools,
wrapQtAppsHook,
mesa,
}:
let
avogadroI18N = fetchFromGitHub {
owner = "OpenChemistry";
repo = "avogadro-i18n";
tag = "1.101.0";
hash = "sha256-3qFx/rc5xqfrLq3Kr5b/Rid2LR/gfP6uqhhATyQL6Y8=";
};
in
stdenv.mkDerivation rec {
pname = "avogadro2";
version = "1.101.0";
src = fetchFromGitHub {
owner = "OpenChemistry";
repo = "avogadroapp";
rev = version;
hash = "sha256-F8to1DyeyyhsivkXDB/KH10/7teVnsoSU/ZHIsNISqc=";
};
postUnpack = ''
cp -r ${avogadroI18N} avogadro-i18n
'';
nativeBuildInputs = [
cmake
wrapQtAppsHook
];
buildInputs = [
avogadrolibs
molequeue
eigen
hdf5
qttools
];
propagatedBuildInputs = [ openbabel ];
qtWrapperArgs = [ "--prefix PATH : ${lib.getBin openbabel}/bin" ];
meta = with lib; {
description = "Molecule editor and visualizer";
mainProgram = "avogadro2";
maintainers = with maintainers; [ sheepforce ];
homepage = "https://github.com/OpenChemistry/avogadroapp";
inherit (mesa.meta) platforms;
license = licenses.bsd3;
};
}

View File

@@ -0,0 +1,234 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
mpiCheckPhaseHook,
which,
openssh,
gcc,
gfortran,
perl,
mpi,
blas,
lapack,
python3,
tcsh,
automake,
autoconf,
libtool,
makeWrapper,
}:
assert blas.isILP64 == lapack.isILP64;
let
versionGA = "5.8.2"; # Fixed by nwchem
gaSrc = fetchFromGitHub {
owner = "GlobalArrays";
repo = "ga";
rev = "v${versionGA}";
hash = "sha256-2ffQIg9topqKX7ygnWaa/UunL9d0Lj9qr9xucsjLuoY=";
};
dftd3Src = fetchurl {
url = "https://www.chemie.uni-bonn.de/grimme/software/dft-d3/dftd3.tgz";
hash = "sha256-2Xz5dY9hqoH9hUJUSPv0pujOB8EukjZzmDGjrzKID1k=";
};
versionLibxc = "6.1.0";
libxcSrc = fetchurl {
url = "https://gitlab.com/libxc/libxc/-/archive/${versionLibxc}/libxc-${versionLibxc}.tar.gz";
hash = "sha256-9ZN0X6R+v7ndxGeqr9wvoSdfDXJQxpLOl2E4mpDdjq8=";
};
plumedSrc = fetchFromGitHub {
owner = "edoapra";
repo = "plumed2";
rev = "88f06db71173e7893713a582e5ada7193e8ae1c9";
hash = "sha256-p5XNxHcE/QkJ5WdQH/xPp2EyrqCNjA/w/e1R2fkwYts=";
};
in
stdenv.mkDerivation rec {
pname = "nwchem";
version = "7.2.3";
src = fetchFromGitHub {
owner = "nwchemgit";
repo = "nwchem";
rev = "v${version}-release";
hash = "sha256-2qc4kLb/WmUJuJGonIyS7pgCfyt8yXdcpDAKU0RMY58=";
};
outputs = [
"out"
"dev"
];
nativeBuildInputs = [
perl
automake
autoconf
libtool
makeWrapper
gfortran
which
];
buildInputs = [
tcsh
openssh
blas
lapack
python3
];
propagatedBuildInputs = [ mpi ];
propagatedUserEnvPkgs = [ mpi ];
postUnpack = ''
# These run 'configure' in source tree and
# require a writable directory
cp -r ${gaSrc}/ source/src/tools/ga-${versionGA}
chmod -R u+w source/src/tools/ga-${versionGA}
cp -r ${plumedSrc} source/src/libext/plumed/plumed2
chmod -R u+w source/src/libext/plumed/plumed2
# Provide tarball in expected location
ln -s ${dftd3Src} source/src/nwpw/nwpwlib/nwpwxc/dftd3.tgz
ln -s ${libxcSrc} source/src/libext/libxc/libxc-${versionLibxc}.tar.gz
'';
postPatch = ''
find -type f -executable -exec sed -i "s:/bin/csh:${tcsh}/bin/tcsh:" \{} \;
find -type f -name "GNUmakefile" -exec sed -i "s:/usr/bin/gcc:${gcc}/bin/gcc:" \{} \;
find -type f -name "GNUmakefile" -exec sed -i "s:/bin/rm:rm:" \{} \;
find -type f -executable -exec sed -i "s:/bin/rm:rm:" \{} \;
find -type f -name "makelib.h" -exec sed -i "s:/bin/rm:rm:" \{} \;
# Overwrite script, skipping the download
echo -e '#!/bin/sh\n cd ga-${versionGA};autoreconf -ivf' > src/tools/get-tools-github
# /usr/bin/env bash fails in sandbox/Makefile setting
substituteInPlace src/config/makefile.h --replace '/usr/bin/env bash' "${stdenv.shell}"
patchShebangs ./
'';
# There is no configure script. Instead the build is controlled via
# environment variables passed to the Makefile
configurePhase = ''
runHook preConfigure
# config parameters
export NWCHEM_TARGET="LINUX64"
export ARMCI_NETWORK="MPI-PR"
export USE_MPI="y"
export USE_MPIF="y"
export NWCHEM_MODULES="all python"
export USE_PYTHONCONFIG="y"
export USE_PYTHON64="n"
export PYTHONLIBTYPE="so"
export PYTHONHOME="${python3}"
export PYTHONVERSION=${lib.versions.majorMinor python3.version}
export BLASOPT="-L${blas}/lib -lblas"
export LAPACK_LIB="-L${lapack}/lib -llapack"
export BLAS_SIZE=${if blas.isILP64 then "8" else "4"}
# extra TCE related options
export MRCC_METHODS="y"
export EACCSD="y"
export IPCCSD="y"
export CCSDTQ="y"
export NWCHEM_TOP="$(pwd)"
runHook postConfigure
'';
# Required for build with gcc-14
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
enableParallelBuilding = true;
preBuild = ''
ln -s ${gaSrc} src/tools/ga-${versionGA}.tar.gz
cd src
make nwchem_config
${lib.optionalString (!blas.isILP64) "make 64_to_32"}
'';
postBuild = ''
cd $NWCHEM_TOP/src/util
make version
make
cd $NWCHEM_TOP/src
make link
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/nwchem
cp $NWCHEM_TOP/bin/LINUX64/nwchem $out/bin/nwchem
cp -r $NWCHEM_TOP/src/data $out/share/nwchem/
cp -r $NWCHEM_TOP/src/basis/libraries $out/share/nwchem/data
cp -r $NWCHEM_TOP/src/nwpw/libraryps $out/share/nwchem/data
wrapProgram $out/bin/nwchem \
--set-default NWCHEM_BASIS_LIBRARY $out/share/nwchem/data/libraries/
cat > $out/share/nwchem/nwchemrc << EOF
nwchem_basis_library $out/share/nwchem/data/libraries/
nwchem_nwpw_library $out/share/nwchem//data/libraryps/
ffield amber
amber_1 $out/share/nwchem/data/amber_s/
amber_2 $out/share/nwchem/data/amber_q/
amber_3 $out/share/nwchem/data/amber_x/
amber_4 $out/share/nwchem/data/amber_u/
spce $out/share/nwchem/data/solvents/spce.rst
charmm_s $out/share/nwchem/data/charmm_s/
charmm_x $out/share/nwchem/data/charmm_x/
EOF
runHook postInstall
'';
doCheck = false;
doInstallCheck = true;
nativeInstallCheckInputs = [ mpiCheckPhaseHook ];
installCheckPhase = ''
runHook preInstallCheck
# run a simple water test
mpirun -np 2 $out/bin/nwchem $NWCHEM_TOP/QA/tests/h2o/h2o.nw > h2o.out
grep "Total SCF energy" h2o.out | grep 76.010538
runHook postInstallCheck
'';
passthru = { inherit mpi; };
meta = with lib; {
description = "Open Source High-Performance Computational Chemistry";
mainProgram = "nwchem";
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with maintainers; [
sheepforce
markuskowa
];
homepage = "https://nwchemgit.github.io";
license = licenses.ecl20;
};
}

View File

@@ -0,0 +1,139 @@
{
lib,
stdenv,
fetchFromGitLab,
fetchFromGitHub,
git,
cmake,
gfortran,
pkg-config,
fftw,
blas,
lapack,
scalapack,
wannier90,
hdf5,
libmbd,
libxc,
enableMpi ? true,
mpi,
}:
assert !blas.isILP64;
assert !lapack.isILP64;
let
# "rev"s must exactly match the git submodule commits in the QE repo
gitSubmodules = {
devxlib = fetchFromGitLab {
group = "max-centre";
owner = "components";
repo = "devicexlib";
rev = "a6b89ef77b1ceda48e967921f1f5488d2df9226d";
hash = "sha256-p3fRplVG4YSN6ILNlOwf+aSEhpTJPXqiS1+wnzWVA2U=";
};
pw2qmcpack = fetchFromGitHub {
owner = "QMCPACK";
repo = "pw2qmcpack";
rev = "f72ab25fa4ea755c1b4b230ae8074b47d5509c70";
hash = "sha256-K1Z90xexsUvk4SdEb8FGryRal0GAFoLz3j1h/RT2nYw=";
};
};
in
stdenv.mkDerivation rec {
version = "7.4.1";
pname = "quantum-espresso";
src = fetchFromGitLab {
owner = "QEF";
repo = "q-e";
rev = "qe-${version}";
hash = "sha256-o1CjIuJCTtIud4zeHROksK1Ub9RL/OB8GecAQOIGf1s=";
};
# add git submodules manually and fix pkg-config file
prePatch = ''
chmod -R +rwx external/
substituteInPlace external/devxlib.cmake \
--replace "qe_git_submodule_update(external/devxlib)" ""
substituteInPlace external/CMakeLists.txt \
--replace "qe_git_submodule_update(external/pw2qmcpack)" "" \
--replace "qe_git_submodule_update(external/d3q)" "" \
--replace "qe_git_submodule_update(external/qe-gipaw)" ""
${toString (
builtins.attrValues (
builtins.mapAttrs (name: val: ''
cp -r ${val}/* external/${name}/.
chmod -R +rwx external/${name}
'') gitSubmodules
)
)}
substituteInPlace cmake/quantum_espresso.pc.in \
--replace 'libdir="''${prefix}/@CMAKE_INSTALL_LIBDIR@"' 'libdir="@CMAKE_INSTALL_FULL_LIBDIR@"'
'';
patches = [
# this patch reverts commit 5fb5a679, which enforced static library builds.
./findLibxc.patch
];
passthru = { inherit mpi; };
nativeBuildInputs = [
cmake
gfortran
git
pkg-config
];
buildInputs = [
fftw
blas
lapack
wannier90
libmbd
libxc
hdf5
]
++ lib.optional enableMpi scalapack;
propagatedBuildInputs = lib.optional enableMpi mpi;
propagatedUserEnvPkgs = lib.optional enableMpi mpi;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DWANNIER90_ROOT=${wannier90}"
"-DMBD_ROOT=${libmbd}"
"-DQE_ENABLE_OPENMP=ON"
"-DQE_ENABLE_LIBXC=ON"
"-DQE_ENABLE_HDF5=ON"
"-DQE_ENABLE_PLUGINS=pw2qmcpack"
]
++ lib.optionals enableMpi [
"-DQE_ENABLE_MPI=ON"
"-DQE_ENABLE_MPI_MODULE=ON"
"-DQE_ENABLE_SCALAPACK=ON"
];
meta = with lib; {
description = "Electronic-structure calculations and materials modeling at the nanoscale";
longDescription = ''
Quantum ESPRESSO is an integrated suite of Open-Source computer codes for
electronic-structure calculations and materials modeling at the
nanoscale. It is based on density-functional theory, plane waves, and
pseudopotentials.
'';
homepage = "https://www.quantum-espresso.org/";
license = licenses.gpl2;
platforms = [
"x86_64-linux"
"x86_64-darwin"
];
maintainers = [ maintainers.costrouc ];
};
}

View File

@@ -0,0 +1,70 @@
diff --git a/cmake/FindLibxc.cmake b/cmake/FindLibxc.cmake
index 011a36b77..226f38051 100644
--- a/cmake/FindLibxc.cmake
+++ b/cmake/FindLibxc.cmake
@@ -1,45 +1,50 @@
-include(FindPackageHandleStandardArgs)
-find_package(PkgConfig REQUIRED)
-
pkg_search_module(_LIBXC libxc>=${Libxc_FIND_VERSION})
-find_library(LIBXC_LIBRARIES NAMES libxc.a
+find_library(LIBXC_LIBRARIES NAMES xc
PATH_SUFFIXES lib
HINTS
- ${LIBXC_ROOT}
ENV EBROOTLIBXC
ENV LIBXCROOT
${_LIBXC_LIBRARY_DIRS}
DOC "libxc libraries list")
-find_library(LIBXC_LIBRARIES_F03 NAMES libxcf03.a
+find_library(LIBXC_LIBRARIES_F90 NAMES xcf90
PATH_SUFFIXES lib
HINTS
- ${LIBXC_ROOT}
ENV EBROOTLIBXC
ENV LIBXCROOT
${_LIBXC_LIBRARY_DIRS}
DOC "libxc libraries list")
+find_library(LIBXC_LIBRARIES_F03 NAMES xcf03
+ PATH_SUFFIXES lib
+ HINTS
+ ENV EBROOTLIBXC
+ ENV LIBXCROOT
+ ${_LIBXC_LIBRARY_DIRS})
find_path(LIBXC_INCLUDE_DIR NAMES xc.h
PATH_SUFFIXES inc include
HINTS
- ${LIBXC_ROOT}
${_LIBXC_INCLUDE_DIRS}
ENV EBROOTLIBXC
ENV LIBXCROOT)
+find_path(LIBXC_INCLUDE_DIR_F90 NAMES xc_f90_lib_m.mod
+ PATH_SUFFIXES inc include
+ HINTS
+ ${_LIBXC_INCLUDE_DIRS}
+ ENV EBROOTLIBXC
+ ENV LIBXCROOT)
find_path(LIBXC_INCLUDE_DIR_F03 NAMES xc_f03_lib_m.mod
PATH_SUFFIXES inc include
HINTS
- ${LIBXC_ROOT}
${_LIBXC_INCLUDE_DIRS}
ENV EBROOTLIBXC
ENV LIBXCROOT)
find_package_handle_standard_args(Libxc DEFAULT_MSG LIBXC_LIBRARIES LIBXC_INCLUDE_DIR)
-if (${Libxc_FOUND} AND LIBXC_LIBRARIES_F03 AND LIBXC_INCLUDE_DIR_F03)
+if (${Libxc_FOUND} AND LIBXC_LIBRARIES_F90 AND LIBXC_LIBRARIES_F03 AND LIBXC_INCLUDE_DIR_F90 AND LIBXC_INCLUDE_DIR_F03)
if(_LIBXC_VERSION)
set(Libxc_VERSION ${_LIBXC_VERSION})
else()
@@ -53,4 +58,3 @@ if (${Libxc_FOUND} AND LIBXC_LIBRARIES_F03 AND LIBXC_INCLUDE_DIR_F03)
else()
unset(Libxc_FOUND)
endif()
-

View File

@@ -0,0 +1,107 @@
{
lib,
stdenv,
gfortran,
blas,
lapack,
scalapack,
useMpi ? false,
mpi,
fetchFromGitLab,
cmake,
pkg-config,
readline,
ninja,
elpa,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "siesta";
version = "5.2.2";
src = fetchFromGitLab {
owner = "siesta-project";
repo = "siesta";
tag = finalAttrs.version;
hash = "sha256-pud8RlJAT+0TwyPRsbf5D/8FfLjZvPYPf84Xb7UH6os=";
fetchSubmodules = true;
};
passthru = {
inherit mpi;
};
nativeBuildInputs = [
ninja
gfortran
cmake
pkg-config
];
buildInputs = [
blas
lapack
readline
elpa
]
++ lib.optionals useMpi [
mpi
scalapack
];
NIX_LDFLAGS = "-lm";
cmakeFlags = [
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
];
enableParallelBuilding = false; # Started making trouble with gcc-11
preBuild = ''
# See https://gitlab.com/siesta-project/siesta/-/commit/a10bf1628e7141ba263841889c3503c263de1582
# This may be fixed in the next release.
makeFlagsArray=(
FFLAGS="-fallow-argument-mismatch"
)
''
+ (
if useMpi then
''
makeFlagsArray+=(
CC="mpicc" FC="mpifort"
FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
);
''
else
''
makeFlagsArray+=(
COMP_LIBS="" LIBS="-lblas -llapack"
);
''
);
meta = {
description = "First-principles materials simulation code using DFT";
mainProgram = "siesta";
longDescription = ''
SIESTA is both a method and its computer program
implementation, to perform efficient electronic structure
calculations and ab initio molecular dynamics simulations of
molecules and solids. SIESTA's efficiency stems from the use
of strictly localized basis sets and from the implementation
of linear-scaling algorithms which can be applied to suitable
systems. A very important feature of the code is that its
accuracy and cost can be tuned in a wide range, from quick
exploratory calculations to highly accurate simulations
matching the quality of other approaches, such as plane-wave
and all-electron methods.
'';
homepage = "https://siesta-project.org/siesta/";
license = lib.licenses.gpl2;
platforms = [ "x86_64-linux" ];
maintainers = [ lib.maintainers.costrouc ];
};
})

View File

@@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
wrapQtAppsHook,
qtbase,
}:
stdenv.mkDerivation rec {
pname = "QtRVSim";
version = "0.9.8";
src = fetchFromGitHub {
owner = "cvut";
repo = "qtrvsim";
tag = "v${version}";
sha256 = "sha256-+EpPDA2+mBTdQjq6i9TN11yeXqvJA28JtmdNihM1a/U=";
};
nativeBuildInputs = [
cmake
wrapQtAppsHook
];
buildInputs = [ qtbase ];
meta = with lib; {
description = "RISC-V CPU simulator for education purposes";
longDescription = ''
RISC-V CPU simulator for education purposes with pipeline and cache visualization.
Developed at FEE CTU for computer architecture classes.
'';
homepage = "https://github.com/cvut/qtrvsim";
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ jdupak ];
mainProgram = "qtrvsim_gui";
};
}

View File

@@ -0,0 +1,83 @@
{
atk,
buildFHSEnv,
cairo,
dpkg,
gdk-pixbuf,
glib,
gtk2-x11,
makeWrapper,
pango,
lib,
stdenv,
xorg,
}:
{
src,
toolName,
version,
...
}@attrs:
let
wrapBinary = libPaths: binaryName: ''
wrapProgram "$out/bin/${binaryName}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libPaths}"
'';
pkg = stdenv.mkDerivation rec {
inherit (attrs) version src;
name = "${toolName}-${version}";
meta =
with lib;
{
homepage = "http://bitscope.com/software/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [
vidbina
];
}
// (attrs.meta or { });
nativeBuildInputs = [
makeWrapper
dpkg
];
libs =
attrs.libs or [
atk
cairo
gdk-pixbuf
glib
gtk2-x11
pango
xorg.libX11
];
dontBuild = true;
unpackPhase =
attrs.unpackPhase or ''
dpkg-deb -x ${attrs.src} ./
'';
installPhase =
attrs.installPhase or ''
mkdir -p "$out/bin"
cp -a usr/* "$out/"
${(wrapBinary libs) attrs.toolName}
'';
};
in
buildFHSEnv {
pname = attrs.toolName;
inherit (attrs) version;
runScript = "${pkg.outPath}/bin/${attrs.toolName}";
}
// {
inherit (pkg) meta name;
}

View File

@@ -0,0 +1,164 @@
{
callPackage,
fetchurl,
}:
let
mkBitscope = callPackage (import ./common.nix) { };
in
{
chart =
let
toolName = "bitscope-chart";
version = "2.0.FK22M";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Multi-channel waveform data acquisition and chart recording application";
homepage = "http://bitscope.com/software/chart/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "08mc82pjamyyyhh15sagsv0sc7yx5v5n54bg60fpj7v41wdwrzxw";
};
};
console =
let
toolName = "bitscope-console";
version = "1.0.FK29A";
in
mkBitscope {
# NOTE: this is meant as a demo by BitScope
inherit toolName version;
meta = {
description = "Demonstrative communications program designed to make it easy to talk to any model BitScope";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "00b4gxwz7w6pmfrcz14326b24kl44hp0gzzqcqxwi5vws3f0y49d";
};
};
display =
let
toolName = "bitscope-display";
version = "1.0.EC17A";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Display diagnostic application for BitScope";
homepage = "http://bitscope.com/software/display/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "05xr5mnka1v3ibcasg74kmj6nlv1nmn3lca1wv77whkq85cmz0s1";
};
};
dso =
let
toolName = "bitscope-dso";
version = "2.8.FE22H";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Test and measurement software for BitScope";
homepage = "http://bitscope.com/software/dso/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0fc6crfkprj78dxxhvhbn1dx1db5chm0cpwlqpqv8sz6whp12mcj";
};
};
logic =
let
toolName = "bitscope-logic";
version = "1.2.FC20C";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Mixed signal logic timing and serial protocol analysis software for BitScope";
homepage = "http://bitscope.com/software/logic/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0lkb7z9gfkiyxdwh4dq1zxfls8gzdw0na1vrrbgnxfg3klv4xns3";
};
};
meter =
let
toolName = "bitscope-meter";
version = "2.0.FK22G";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Automated oscilloscope, voltmeter and frequency meter for BitScope";
homepage = "http://bitscope.com/software/logic/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "0nirbci6ymhk4h4bck2s4wbsl5r9yndk2jvvv72zwkg21248mnbp";
};
};
proto =
let
toolName = "bitscope-proto";
version = "0.9.FG13B";
in
mkBitscope {
inherit toolName version;
# NOTE: this is meant as a demo by BitScope
# NOTE: clicking on logo produces error
# TApplication.HandleException Executable not found: "http://bitscope.com/blog/DK/?p=DK15A"
meta = {
description = "Demonstrative prototype oscilloscope built using the BitScope Library";
homepage = "http://bitscope.com/blog/DK/?p=DK15A";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "1ybjfbh3narn29ll4nci4b7rnxy0hj3wdfm4v8c6pjr8pfvv9spy";
};
};
server =
let
toolName = "bitscope-server";
version = "1.0.FK26A";
in
mkBitscope {
inherit toolName version;
meta = {
description = "Remote access server solution for any BitScope";
homepage = "http://bitscope.com/software/server/";
};
src = fetchurl {
url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
sha256 = "1079n7msq6ks0n4aasx40rd4q99w8j9hcsaci71nd2im2jvjpw9a";
};
};
}

View File

@@ -0,0 +1,39 @@
{
mkDerivation,
lib,
fetchFromGitHub,
cmake,
qtbase,
qttools,
qtsvg,
qwt6_1,
}:
mkDerivation rec {
pname = "caneda";
version = "0.4.0";
src = fetchFromGitHub {
owner = "Caneda";
repo = "Caneda";
rev = version;
sha256 = "sha256-oE0cdOwufc7CHEFr3YU8stjg1hBGs4bemhXpNTCTpDQ=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
qtbase
qttools
qtsvg
qwt6_1
];
meta = {
description = "Open source EDA software focused on easy of use and portability";
mainProgram = "caneda";
homepage = "http://caneda.org";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = with lib.platforms; linux;
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
boost183,
qtbase,
qtimageformats,
qttools,
wrapQtAppsHook,
}:
let
boost_static = boost183.override { enableStatic = true; };
in
stdenv.mkDerivation rec {
pname = "degate";
version = "2.0.0";
src = fetchFromGitHub {
owner = "DegateCommunity";
repo = "Degate";
tag = "v${version}";
hash = "sha256-INoA3Z6ya03ZMn6E+nOCkXZLoxoo2WgPDw9v5miI09A=";
};
patches = [
# bump bundled catch2 to avoid incompatibility with modern glibc
(fetchpatch {
name = "catch2-2.13.9.patch";
url = "https://github.com/DegateCommunity/Degate/commit/06346dde4312cbb867854899eacf58679d6ac7e2.patch";
includes = [ "tests/catch2/catch.hpp" ];
hash = "sha256-SbSA813QI8RRVy1lvAOGMGAC2KUQKjwYR2imqX40pvU=";
})
];
postPatch = ''
sed -i -E '/(_OUTPUT_DIRECTORY|DESTINATION)/s|\bout/||g' CMakeLists.txt
'';
nativeBuildInputs = [
cmake
qttools
wrapQtAppsHook
];
buildInputs = [
boost_static
qtbase
];
doCheck = true;
checkPhase = ''
runHook preCheck
(
cd tests/out/bin
# provide qtimageformats plugin to allow tests to read tiff files
export QT_PLUGIN_PATH="${qtimageformats}/${qtbase.qtPluginPrefix}"
./DegateTests
)
runHook postCheck
'';
meta = with lib; {
description = "Modern and open-source cross-platform software for chips reverse engineering";
mainProgram = "Degate";
homepage = "https://degate.readthedocs.io/";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ ris ];
};
}

View File

@@ -0,0 +1,70 @@
{
stdenv,
lib,
fetchFromGitHub,
pkg-config,
cmake,
wrapQtAppsHook,
libzip,
boost,
fftw,
libusb1,
qtbase,
qtsvg,
qtwayland,
python3,
desktopToDarwinBundle,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dsview";
version = "1.3.2";
src = fetchFromGitHub {
owner = "DreamSourceLab";
repo = "DSView";
rev = "v${finalAttrs.version}";
sha256 = "sha256-d/TfCuJzAM0WObOiBhgfsTirlvdROrlCm+oL1cqUrIs=";
};
patches = [
# Fix absolute install paths
./install.patch
];
# /build/source/libsigrok4DSL/strutil.c:343:19: error: implicit declaration of function 'strcasecmp'; did you mean 'g_strcasecmp'? []
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
boost
fftw
qtbase
qtsvg
libusb1
libzip
python3
]
++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
doInstallCheck = true;
meta = {
description = "GUI program for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc";
mainProgram = "DSView";
homepage = "https://www.dreamsourcelab.com/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
bachp
carlossless
];
};
})

View File

@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb9be42..220817c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -662,16 +662,8 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app
install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
- install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop)
-
- if(IS_DIRECTORY /usr/lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /usr/lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /lib/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
- elseif(IS_DIRECTORY /etc/udev/rules.d)
- install(FILES DSView/DreamSourceLab.rules DESTINATION /etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
- endif()
-
+ install(FILES DSView/DreamSourceLab.rules DESTINATION etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
endif()
+install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop)
install(FILES NEWS25 DESTINATION share/DSView RENAME NEWS25)

View File

@@ -0,0 +1,136 @@
{
lib,
stdenv,
mkDerivation,
fetchurl,
makeDesktopItem,
libXrender,
libXrandr,
libXcursor,
libX11,
libXext,
libXi,
libxcb,
libGL,
glib,
nss,
nspr,
expat,
alsa-lib,
qtbase,
qtdeclarative,
qtsvg,
qtlocation,
qtwebchannel,
qtwebengine,
}:
let
libPath = lib.makeLibraryPath [
libXrender
libXrandr
libXcursor
libX11
libXext
libXi
libxcb
libGL
glib
nss
nspr
expat
alsa-lib
qtbase
qtdeclarative
qtsvg
qtlocation
qtwebchannel
qtwebengine
];
in
mkDerivation rec {
pname = "eagle";
version = "9.6.2";
src = fetchurl {
url = "https://eagle-updates.circuits.io/downloads/${
builtins.replaceStrings [ "." ] [ "_" ] version
}/Autodesk_EAGLE_${version}_English_Linux_64bit.tar.gz";
sha256 = "18syygnskl286kn8aqfzzdsyzq59d2w19y1h1ynyxsnrvkyv71h0";
};
desktopItem = makeDesktopItem {
name = "eagle";
exec = "eagle";
icon = "eagle";
comment = "Schematic capture and PCB layout";
desktopName = "Eagle";
genericName = "Schematic editor";
categories = [ "Development" ];
};
buildInputs = [
libXrender
libXrandr
libXcursor
libX11
libXext
libXi
libxcb
libGL
glib
nss
nspr
expat
alsa-lib
qtbase
qtdeclarative
qtsvg
qtlocation
qtwebchannel
qtwebengine
];
installPhase = ''
# Extract eagle tarball
mkdir "$out"
tar -xzf "$src" -C "$out"
# Install manpage
mkdir -p "$out"/share/man/man1
ln -s "$out"/eagle-${version}/doc/eagle.1 "$out"/share/man/man1/eagle.1
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}:$out/eagle-${version}/lib:${lib.getLib stdenv.cc.cc}/lib" \
"$out"/eagle-${version}/eagle
mkdir -p "$out"/bin
ln -s "$out"/eagle-${version}/eagle "$out"/bin/eagle
# Remove bundled libraries that are available in nixpkgs
# TODO: There still may be unused bundled libraries
rm "$out"/eagle-${version}/lib/libQt5*.so.5
rm "$out"/eagle-${version}/lib/{libxcb-*.so.*,libX*.so.*,libxshmfence.so.1}
rm "$out"/eagle-${version}/lib/{libEGL.so.1,libglapi.so.0,libgbm.so.1}
# No longer needed (we don't use the bundled Qt libraries)
rm -r "$out"/eagle-${version}/libexec
rm -r "$out"/eagle-${version}/plugins
# Make desktop item
mkdir -p "$out"/share/applications
cp "$desktopItem"/share/applications/* "$out"/share/applications/
mkdir -p "$out"/share/pixmaps
ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/pixmaps/eagle.png
'';
meta = with lib; {
description = "Schematic editor and PCB layout tool from Autodesk (formerly CadSoft)";
homepage = "https://www.autodesk.com/products/eagle/overview";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ ];
};
}

View File

@@ -0,0 +1,134 @@
/*
* LD_PRELOAD trick to make Eagle (schematic editor and PCB layout tool from
* CadSoft) work from a read-only installation directory.
*
* When Eagle starts, it looks for the license file in <eagle>/bin/eagle.key
* (where <eagle> is the install path). If eagle.key is not found, Eagle checks
* for write access to <eagle>/bin/, shows a license dialog to the user and
* then attempts to write a license file to <eagle>/bin/.
*
* This will of course fail when Eagle is installed in the read-only Nix store.
* Hence this library that redirects accesses to the those paths in the
* following way:
*
* <eagle>/bin => $HOME
* <eagle>/bin/eagle.key => $HOME/.eagle.key
*
* Also, if copying an example project to ~/eagle/ (in the Eagle GUI), Eagle
* chmod's the destination with read-only permission bits (presumably because
* the source is read-only) and fails to complete the copy operation.
* Therefore, the mode argument in calls to chmod() is OR'ed with the S_IWUSR
* bit (write by owner).
*
* Usage:
* gcc -shared -fPIC -DEAGLE_PATH="$out/eagle-${version}" eagle_fixer.c -o eagle_fixer.so -ldl
* LD_PRELOAD=$PWD/eagle_fixer.so ./result/bin/eagle
*
* To see the paths that are modified at runtime, set the environment variable
* EAGLE_FIXER_DEBUG to 1.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <limits.h>
#include <sys/stat.h>
#ifndef EAGLE_PATH
#error Missing EAGLE_PATH, path to the eagle-${version} installation directory.
#endif
typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
typedef int (*access_func_t)(const char *pathname, int mode);
typedef int (*chmod_func_t)(const char *path, mode_t mode);
/*
* Map <eagle>/bin to $HOME and <eagle>/bin/eagle.key to $HOME/.eagle.key
*
* Path is truncated if bigger than PATH_MAX. It's not threadsafe, but that's
* OK.
*/
static const char *redirect(const char *pathname)
{
static char buffer[PATH_MAX];
const char *homepath;
const char *new_path;
static int have_warned;
homepath = getenv("HOME");
if (!homepath) {
homepath = "/";
if (!have_warned && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: HOME is unset, using \"/\" (root) instead.\n");
have_warned = 1;
}
}
new_path = pathname;
if (strcmp(EAGLE_PATH "/bin", pathname) == 0) {
/* redirect to $HOME */
new_path = homepath;
} else if (strcmp(EAGLE_PATH "/bin/eagle.key", pathname) == 0) {
/* redirect to $HOME/.eagle.key */
snprintf(buffer, PATH_MAX, "%s/.eagle.key", homepath);
buffer[PATH_MAX-1] = '\0';
new_path = buffer;
}
return new_path;
}
FILE *fopen(const char *pathname, const char *mode)
{
FILE *fp;
const char *path;
fopen_func_t orig_fopen;
orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
path = redirect(pathname);
fp = orig_fopen(path, mode);
if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: fopen(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
}
return fp;
}
int access(const char *pathname, int mode)
{
int ret;
const char *path;
access_func_t orig_access;
orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
path = redirect(pathname);
ret = orig_access(path, mode);
if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: access(\"%s\", %d) => \"%s\": ret=%d\n", pathname, mode, path, ret);
}
return ret;
}
int chmod(const char *pathname, mode_t mode)
{
int ret;
mode_t new_mode;
chmod_func_t orig_chmod;
orig_chmod = (chmod_func_t)dlsym(RTLD_NEXT, "chmod");
new_mode = mode | S_IWUSR;
ret = orig_chmod(pathname, new_mode);
if (getenv("EAGLE_FIXER_DEBUG")) {
fprintf(stderr, "eagle_fixer: chmod(\"%s\", %o) => %o: ret=%d\n", pathname, mode, new_mode, ret);
}
return ret;
}

View File

@@ -0,0 +1,143 @@
{
stdenv,
lib,
fetchFromGitHub,
wrapQtAppsHook,
qmake,
pkg-config,
qtbase,
qtsvg,
qttools,
qtserialport,
qtwayland,
qt5compat,
boost,
libngspice,
libgit2,
quazip,
clipper,
}:
let
# SHA256 of the fritzing-parts HEAD on the master branch,
# which contains the latest stable parts definitions
partsSha = "76235099ed556e52003de63522fdd74e61d53a36";
parts = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-parts";
rev = partsSha;
hash = "sha256-1QVcPbRBOSYnNFsp7B2OyPXYuPaINRv9yEqGZFd662Y=";
};
# Header-only library
svgpp = fetchFromGitHub {
owner = "svgpp";
repo = "svgpp";
tag = "v1.3.1";
hash = "sha256-nW0ns06XWfUi22nOKZzFKgAOHVIlQqChW8HxUDOFMh4=";
};
in
stdenv.mkDerivation {
pname = "fritzing";
version = "1.0.4";
src = fetchFromGitHub {
owner = "fritzing";
repo = "fritzing-app";
rev = "a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25";
hash = "sha256-a/bWAUeDPj3g8BECOlXuqyCi4JgGLLs1605m380Drt0=";
};
patches = [
# Fix build with Qt >= 6.9
./fix-stricter-types.patch
];
nativeBuildInputs = [
qmake
pkg-config
qttools
wrapQtAppsHook
];
buildInputs = [
qtbase
qtsvg
qtserialport
qt5compat
boost
libgit2
quazip
libngspice
clipper
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
];
postPatch = ''
# Use packaged quazip, libgit and ngspice
sed -i "/pri\/quazipdetect.pri/d" phoenix.pro
sed -i "/pri\/spicedetect.pri/d" phoenix.pro
substituteInPlace pri/libgit2detect.pri \
--replace-fail 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
#TODO: Do not hardcode SHA.
substituteInPlace src/fapplication.cpp \
--replace-fail 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
substituteInPlace phoenix.pro \
--replace-fail "6.5.10" "${qtbase.version}"
substituteInPlace src/simulation/ngspice_simulator.cpp \
--replace-fail 'path + "/" + libName' '"${libngspice}/lib/libngspice.so"'
mkdir parts
cp -a ${parts}/* parts/
'';
env = {
NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
"-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}"
"-I${svgpp}/include"
"-I${clipper}/include/polyclipping"
];
NIX_LDFLAGS = "-lquazip1-qt${lib.versions.major qtbase.version}";
};
qmakeFlags = [
"phoenix.pro"
];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir $out/Applications
mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
makeWrapper $out/Applications/Fritzing.app/Contents/MacOS/Fritzing $out/bin/Fritzing
'';
postFixup = ''
# generate the parts.db file
QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
-db "$out/share/fritzing/parts/parts.db" \
-pp "$out/share/fritzing/parts" \
-folder "$out/share/fritzing"
'';
meta = {
description = "Open source prototyping tool for Arduino-based projects";
homepage = "https://fritzing.org";
license = with lib.licenses; [
gpl3
cc-by-sa-30
];
maintainers = with lib.maintainers; [
robberer
muscaln
];
platforms = lib.platforms.unix;
mainProgram = "Fritzing";
};
}

View File

@@ -0,0 +1,57 @@
diff --git a/src/items/paletteitembase.cpp b/src/items/paletteitembase.cpp
index 49db343e..8760ba55 100644
--- a/src/items/paletteitembase.cpp
+++ b/src/items/paletteitembase.cpp
@@ -626,7 +626,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
//DebugDialog::debug(QString("path: %1").arg(path));
- QString svg = svgHash.value(path + xmlName + QString(QChar(m_viewLayerPlacement)), "");
+ QString svg = svgHash.value(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), "");
if (!svg.isEmpty()) return svg;
SvgFileSplitter splitter;
@@ -657,7 +657,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash<Q
return "";
}
svg = splitter.elementString(xmlName);
- svgHash.insert(path + xmlName + QString(QChar(m_viewLayerPlacement)), svg);
+ svgHash.insert(path + xmlName + QString(QChar(static_cast<ushort>(m_viewLayerPlacement))), svg);
return svg;
}
diff --git a/src/items/resistor.cpp b/src/items/resistor.cpp
index e2a23fd8..3fb4c669 100644
--- a/src/items/resistor.cpp
+++ b/src/items/resistor.cpp
@@ -260,7 +260,7 @@ bool Resistor::collectExtraInfo(QWidget * parent, const QString & family, const
validator->setSymbol(OhmSymbol);
validator->setConverter(TextUtils::convertFromPowerPrefix);
validator->setBounds(MIN_RESISTANCE, MAX_RESISTANCE);
- validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(TextUtils::MicroSymbolCode, 4, 16, QChar('0'))));
+ validator->setRegularExpression(QRegularExpression(QString("((\\d{1,10})|(\\d{1,10}\\.)|(\\d{1,10}\\.\\d{1,5}))[\\x%1umkMG]{0,1}[\\x03A9]{0,1}").arg(static_cast<int>(TextUtils::MicroSymbolCode), 4, 16, QChar('0'))));
focusOutComboBox->setValidator(validator);
connect(focusOutComboBox->validator(), SIGNAL(sendState(QValidator::State)), this, SLOT(textModified(QValidator::State)));
connect(focusOutComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(resistanceEntry(int)));
diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp
index a1a28d51..3d3aa8e0 100644
--- a/src/utils/textutils.cpp
+++ b/src/utils/textutils.cpp
@@ -79,7 +79,7 @@ const QString TextUtils::AdobeIllustratorIdentifier = "Generator: Adobe Illustra
QList<QString> PowerPrefixes;
QList<double> PowerPrefixValues;
-const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(MicroSymbolCode, 4, 16, QChar('0'));
+const QString TextUtils::PowerPrefixesString = QString("pnmkMGTu\\x%1").arg(static_cast<int>(MicroSymbolCode), 4, 16, QChar('0'));
typedef QHash<QString /*brokenFont*/, QString /*replacementFont*/> FixedFontsHash;
@@ -763,7 +763,7 @@ QString TextUtils::convertExtendedChars(const QString & str)
result.append(c);
}
else {
- result.append(QString("&#x%1;").arg(c.unicode(), 0, 16));
+ result.append("&#x" + QString::number(c.unicode(), 16) + ";");
}
}

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
autoreconfHook,
groff,
pkg-config,
guile,
gtk2,
flex,
gawk,
perl,
}:
stdenv.mkDerivation rec {
pname = "geda";
version = "1.10.2";
src = fetchurl {
url = "http://ftp.geda-project.org/geda-gaf/stable/v${lib.versions.majorMinor version}/${version}/geda-gaf-${version}.tar.gz";
hash = "sha256-6GKrJBUoU4+jvuJzkmH1aAERArYMXjmi8DWGY8BCyKQ=";
};
patches = [
(fetchpatch {
name = "geda-1.10.2-drop-xorn.patch";
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-electronics/geda/files/geda-1.10.2-drop-xorn.patch?id=5589cc7bc6c4f18f75c40725a550b8d76e7f5ca1";
hash = "sha256-jPQaHjEDwCEfZqDGku+xyIMl5WlWlVcpPv1W6Xf8Grs=";
})
];
configureFlags = [
"--disable-update-xdg-database"
"--without-libfam"
];
nativeBuildInputs = [
autoreconfHook
groff
pkg-config
];
buildInputs = [
guile
gtk2
flex
gawk
perl
];
meta = with lib; {
description = "Full GPL'd suite of Electronic Design Automation tools";
homepage = "https://geda.sourceforge.net/";
maintainers = with maintainers; [ pjones ];
platforms = platforms.linux;
license = licenses.gpl2;
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
autoconf,
automake,
autoreconfHook,
cairo,
fetchFromGitHub,
gettext,
gtk2-x11,
libtool,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "gerbv";
version = "2.10.0";
src = fetchFromGitHub {
owner = "gerbv";
repo = "gerbv";
tag = "v${version}";
hash = "sha256-sr48RGLYcMKuyH9p+5BhnR6QpKBvNOqqtRryw3+pbBk=";
};
postPatch = ''
sed -i '/AC_INIT/s/m4_esyscmd.*/${version}])/' configure.ac
'';
nativeBuildInputs = [
autoconf
automake
autoreconfHook
pkg-config
];
buildInputs = [
cairo
gettext
gtk2-x11
libtool
];
configureFlags = [
"--disable-update-desktop-database"
];
meta = {
description = "Gerber (RS-274X) viewer";
mainProgram = "gerbv";
homepage = "https://gerbv.github.io/";
changelog = "https://github.com/gerbv/gerbv/releases/tag/v${version}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ mog ];
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,5 @@
{ kicad }:
{
kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; };
kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; };
}

View File

@@ -0,0 +1,57 @@
# For building the multiple addons that are in the kikit repo.
{
stdenv,
bc,
kikit,
zip,
python3,
addonName,
addonPath,
}:
let
# This python is only used when building the package, it's not the python
# environment that will ultimately run the code packaged here. The python env defined
# in KiCad will import the python code packaged here when KiCad starts up.
python = python3.withPackages (ps: with ps; [ click ]);
kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; });
# The following different addons can be built from the same source.
targetSpecs = {
"kikit" = {
makeTarget = "pcm-kikit";
resultZip = "pcm-kikit.zip";
description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow";
};
"kikit-library" = {
makeTarget = "pcm-lib";
resultZip = "pcm-kikit-lib.zip";
description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel)";
};
};
targetSpec = targetSpecs.${addonName};
in
stdenv.mkDerivation {
pname = "kicadaddon-${addonName}";
inherit (kikit-module) src version;
nativeBuildInputs = [
python
bc
zip
];
propagatedBuildInputs = [ kikit-module ];
buildPhase = ''
patchShebangs scripts/setJson.py
make ${targetSpec.makeTarget}
'';
installPhase = ''
mkdir $out
mv build/${targetSpec.resultZip} $out/${addonPath}
'';
meta = kikit-module.meta // {
description = targetSpec.description;
};
}

View File

@@ -0,0 +1,214 @@
{
lib,
stdenv,
cmake,
libGLU,
libGL,
zlib,
wxGTK,
gtk3,
libX11,
gettext,
glew,
glm,
cairo,
curl,
openssl,
boost,
pkg-config,
doxygen,
graphviz,
libpthreadstubs,
libXdmcp,
unixODBC,
libgit2,
libsecret,
libgcrypt,
libgpg-error,
ninja,
writableTmpDirAsHomeHook,
util-linuxMinimal,
libselinux,
libsepol,
libthai,
libdatrie,
libxkbcommon,
libepoxy,
dbus,
at-spi2-core,
libXtst,
pcre2,
libdeflate,
swig,
python,
wxPython,
opencascade-occt_7_6,
libngspice,
valgrind,
protobuf_29,
nng,
stable,
testing,
kicadSrc,
kicadVersion,
withNgspice,
withScripting,
withI18n,
debug,
sanitizeAddress,
sanitizeThreads,
}:
assert lib.assertMsg (
!(sanitizeAddress && sanitizeThreads)
) "'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
assert testing -> !stable -> throw "testing implies stable and cannot be used with stable = false";
let
opencascade-occt = opencascade-occt_7_6;
inherit (lib)
cmakeBool
cmakeFeature
optionals
optionalString
;
in
stdenv.mkDerivation (finalAttrs: {
pname = "kicad-base";
version = if stable then kicadVersion else builtins.substring 0 10 finalAttrs.src.rev;
src = kicadSrc;
patches = [
# upstream issue 12941 (attempted to upstream, but appreciably unacceptable)
./writable.patch
# https://gitlab.com/kicad/code/kicad/-/issues/15687
./runtime_stock_data_path.patch
];
# tagged releases don't have "unknown"
# kicad testing and nightlies use git describe --dirty
# nix removes .git, so its approximated here
postPatch = lib.optionalString (!stable || testing) ''
substituteInPlace cmake/KiCadVersion.cmake \
--replace-fail "unknown" "${builtins.substring 0 10 finalAttrs.src.rev}"
substituteInPlace cmake/CreateGitVersionHeader.cmake \
--replace-fail "0000000000000000000000000000000000000000" "${finalAttrs.src.rev}"
'';
preConfigure = optionalString debug ''
export CFLAGS="''${CFLAGS:-} -Og -ggdb"
export CXXFLAGS="''${CXXFLAGS:-} -Og -ggdb"
'';
cmakeFlags = [
(cmakeBool "KICAD_USE_EGL" true)
(cmakeFeature "OCC_INCLUDE_DIR" "${opencascade-occt}/include/opencascade")
# https://gitlab.com/kicad/code/kicad/-/issues/17133
(cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;qa_spice")
(cmakeBool "KICAD_USE_CMAKE_FINDPROTOBUF" false)
(cmakeBool "KICAD_SCRIPTING_WXPYTHON" withScripting)
(cmakeBool "KICAD_BUILD_I18N" withI18n)
(cmakeBool "KICAD_BUILD_QA_TESTS" (!finalAttrs.doInstallCheck))
(cmakeBool "KICAD_STDLIB_DEBUG" debug)
(cmakeBool "KICAD_USE_VALGRIND" debug)
(cmakeBool "KICAD_SANITIZE_ADDRESS" sanitizeAddress)
(cmakeBool "KICAD_SANITIZE_THREADS" sanitizeThreads)
(cmakeBool "KICAD_SPICE" (!(stable && !withNgspice)))
]
++ optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
(cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'qa_spice|qa_cli'")
];
cmakeBuildType = if debug then "Debug" else "Release";
nativeBuildInputs = [
cmake
ninja
doxygen
graphviz
pkg-config
libgit2
libsecret
libgcrypt
libgpg-error
]
# wanted by configuration on linux, doesn't seem to affect performance
# no effect on closure size
++ optionals (stdenv.hostPlatform.isLinux) [
util-linuxMinimal
libselinux
libsepol
libthai
libdatrie
libxkbcommon
libepoxy
dbus
at-spi2-core
libXtst
pcre2
];
buildInputs = [
libGLU
libGL
zlib
libX11
wxGTK
gtk3
libXdmcp
gettext
glew
glm
libpthreadstubs
cairo
curl
openssl
boost
swig
python
unixODBC
libdeflate
opencascade-occt
protobuf_29
# This would otherwise cause a linking requirement for mbedtls.
(nng.override { mbedtlsSupport = false; })
]
++ optionals withScripting [ wxPython ]
++ optionals withNgspice [ libngspice ]
++ optionals debug [ valgrind ];
# debug builds fail all but the python test
doInstallCheck = !debug;
installCheckTarget = "test";
nativeInstallCheckInputs = [
(python.withPackages (
ps: with ps; [
numpy
pytest
cairosvg
pytest-image-diff
]
))
writableTmpDirAsHomeHook
];
dontStrip = debug;
meta = {
description = "Just the built source without the libraries";
longDescription = ''
Just the build products, the libraries are passed via an env var in the wrapper, default.nix
'';
homepage = "https://www.kicad.org/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
broken = stdenv.hostPlatform.isDarwin;
};
})

View File

@@ -0,0 +1,334 @@
{
lib,
stdenv,
runCommand,
newScope,
fetchFromGitLab,
makeWrapper,
symlinkJoin,
callPackage,
callPackages,
adwaita-icon-theme,
dconf,
gtk3,
wxGTK32,
librsvg,
cups,
gsettings-desktop-schemas,
hicolor-icon-theme,
unzip,
jq,
pname ? "kicad",
stable ? true,
testing ? false,
withNgspice ? !stdenv.hostPlatform.isDarwin,
libngspice,
withScripting ? true,
python3,
addons ? [ ],
debug ? false,
sanitizeAddress ? false,
sanitizeThreads ? false,
with3d ? true,
withI18n ? true,
srcs ? { },
}:
# `addons`: https://dev-docs.kicad.org/en/addons/
#
# ```nix
# kicad = pkgs.kicad.override {
# addons = with pkgs.kicadAddons; [ kikit kikit-library ];
# };
# ```
# The `srcs` parameter can be used to override the kicad source code
# and all libraries, which are otherwise inaccessible
# to overlays since most of the kicad build expression has been
# refactored into base.nix, most of the library build expressions have
# been refactored into libraries.nix. Overrides are only applied when
# building `kicad-unstable`. The `srcs` parameter has
# no effect for stable `kicad`. `srcs` takes an attribute set in which
# any of the following attributes are meaningful (though none are
# mandatory): "kicad", "kicadVersion", "symbols", "templates",
# "footprints", "packages3d", and "libVersion". "kicadVersion" and
# "libVersion" should be set to a string with the desired value for
# the version attribute in kicad's `mkDerivation` and the version
# attribute in any of the library's `mkDerivation`, respectively.
# "kicad", "symbols", "templates", "footprints", and "packages3d"
# should be set to an appropriate fetcher (e.g. `fetchFromGitLab`).
# So, for example, a possible overlay for kicad is:
#
# final: prev:
# {
# kicad-unstable = (prev.kicad-unstable.override {
# srcs = {
# kicadVersion = "2020-10-08";
# kicad = prev.fetchFromGitLab {
# group = "kicad";
# owner = "code";
# repo = "kicad";
# rev = "fd22fe8e374ce71d57e9f683ba996651aa69fa4e";
# sha256 = "sha256-F8qugru/jU3DgZSpQXQhRGNFSk0ybFRkpyWb7HAGBdc=";
# };
# };
# });
# }
let
baseName =
if testing then
"kicad-testing"
else if stable then
"kicad"
else
"kicad-unstable";
versionsImport = import ./versions.nix;
# versions.nix does not provide us with version, src and rev. We
# need to turn this into appropriate fetcher calls.
kicadSrcFetch = fetchFromGitLab {
group = "kicad";
owner = "code";
repo = "kicad";
rev = versionsImport.${baseName}.kicadVersion.src.rev;
sha256 = versionsImport.${baseName}.kicadVersion.src.sha256;
};
libSrcFetch =
name:
fetchFromGitLab {
group = "kicad";
owner = "libraries";
repo = "kicad-${name}";
rev = versionsImport.${baseName}.libVersion.libSources.${name}.rev;
sha256 = versionsImport.${baseName}.libVersion.libSources.${name}.sha256;
};
# only override `src` or `version` if building `kicad-unstable` with
# the appropriate attribute defined in `srcs`.
srcOverridep = attr: (!stable && builtins.hasAttr attr srcs);
# use default source and version (as defined in versions.nix) by
# default, or use the appropriate attribute from `srcs` if building
# unstable with `srcs` properly defined.
kicadSrc = if srcOverridep "kicad" then srcs.kicad else kicadSrcFetch;
kicadVersion =
if srcOverridep "kicadVersion" then
srcs.kicadVersion
else
versionsImport.${baseName}.kicadVersion.version;
libSrc = name: if srcOverridep name then srcs.${name} else libSrcFetch name;
# TODO does it make sense to only have one version for all libs?
libVersion =
if srcOverridep "libVersion" then
srcs.libVersion
else
versionsImport.${baseName}.libVersion.version;
wxGTK = wxGTK32;
python = python3;
wxPython = python.pkgs.wxpython;
addonPath = "addon.zip";
addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons;
addonsJoined =
runCommand "addonsJoined"
{
inherit addonsDrvs;
nativeBuildInputs = [
unzip
jq
];
}
''
mkdir $out
for pkg in $addonsDrvs; do
unzip $pkg/addon.zip -d unpacked
folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _)
for d in unpacked/*; do
if [ -d "$d" ]; then
dest=$out/share/kicad/scripting/$(basename $d)/$folder_name
mkdir -p $(dirname $dest)
mv $d $dest
fi
done
rm -r unpacked
done
'';
inherit (lib)
concatStringsSep
flatten
optionalString
optionals
;
in
stdenv.mkDerivation rec {
# Common libraries, referenced during runtime, via the wrapper.
passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
passthru.callPackage = newScope { inherit addonPath python3; };
base = callPackage ./base.nix {
inherit stable testing;
inherit kicadSrc kicadVersion;
inherit wxGTK python wxPython;
inherit withNgspice withScripting withI18n;
inherit debug sanitizeAddress sanitizeThreads;
};
inherit pname;
version = if stable then kicadVersion else builtins.substring 0 10 src.src.rev;
src = base;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
dontFixup = true;
pythonPath =
optionals withScripting [
wxPython
python.pkgs.six
python.pkgs.requests
]
++ addonsDrvs;
nativeBuildInputs = [ makeWrapper ] ++ optionals withScripting [ python.pkgs.wrapPython ];
# KICAD7_TEMPLATE_DIR only works with a single path (it does not handle : separated paths)
# but it's used to find both the templates and the symbol/footprint library tables
# https://gitlab.com/kicad/code/kicad/-/issues/14792
template_dir = symlinkJoin {
name = "KiCad_template_dir";
paths = with passthru.libraries; [
"${templates}/share/kicad/template"
"${footprints}/share/kicad/template"
"${symbols}/share/kicad/template"
];
};
# We are emulating wrapGAppsHook3, along with other variables to the wrapper
makeWrapperArgs =
with passthru.libraries;
[
"--prefix XDG_DATA_DIRS : ${base}/share"
"--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
"--prefix XDG_DATA_DIRS : ${adwaita-icon-theme}/share"
"--prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}"
"--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
# wrapGAppsHook3 did these two as well, no idea if it matters...
"--prefix XDG_DATA_DIRS : ${cups}/share"
"--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
# required to open a bug report link in firefox-wayland
"--set-default MOZ_DBUS_REMOTE 1"
"--set-default KICAD9_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
"--set-default KICAD9_SYMBOL_DIR ${symbols}/share/kicad/symbols"
"--set-default KICAD9_TEMPLATE_DIR ${template_dir}"
]
++ optionals (addons != [ ]) (
let
stockDataPath = symlinkJoin {
name = "kicad_stock_data_path";
paths = [
"${base}/share/kicad"
"${addonsJoined}/share/kicad"
];
};
in
[ "--set-default NIX_KICAD9_STOCK_DATA_PATH ${stockDataPath}" ]
)
++ optionals with3d [
"--set-default KICAD9_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
]
++ optionals withNgspice [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
# infinisil's workaround for #39493
++ [ "--set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ];
# why does $makeWrapperArgs have to be added explicitly?
# $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
installPhase =
let
bin = if stdenv.hostPlatform.isDarwin then "*.app/Contents/MacOS" else "bin";
tools = [
"kicad"
"pcbnew"
"eeschema"
"gerbview"
"pcb_calculator"
"pl_editor"
"bitmap2component"
"kicad-cli"
];
utils = [
"dxf2idf"
"idf2vrml"
"idfcyl"
"idfrect"
];
in
(concatStringsSep "\n" (flatten [
"runHook preInstall"
(optionalString withScripting "buildPythonPath \"${base} $pythonPath\" \n")
# wrap each of the directly usable tools
(map (
tool:
"makeWrapper ${base}/${bin}/${tool} $out/bin/${tool} $makeWrapperArgs"
+ optionalString withScripting " --set PYTHONPATH \"$program_PYTHONPATH\""
) tools)
# link in the CLI utils
(map (util: "ln -s ${base}/${bin}/${util} $out/bin/${util}") utils)
"runHook postInstall"
]));
postInstall = ''
mkdir -p $out/share
ln -s ${base}/share/applications $out/share/applications
ln -s ${base}/share/icons $out/share/icons
ln -s ${base}/share/mime $out/share/mime
ln -s ${base}/share/metainfo $out/share/metainfo
'';
passthru.updateScript = {
command = [
./update.sh
"${pname}"
];
supportedFeatures = [ "commit" ];
};
meta = {
description =
(
if stable then
"Open Source Electronics Design Automation suite"
else if testing then
"Open Source EDA suite, latest on stable branch"
else
"Open Source EDA suite, latest on master branch"
)
+ (lib.optionalString (!with3d) ", without 3D models");
homepage = "https://www.kicad.org/";
longDescription = ''
KiCad is an open source software suite for Electronic Design Automation.
The Programs handle Schematic Capture, and PCB Layout with Gerber output.
'';
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.all;
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "kicad";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
cmake,
libSrc,
stepreduce,
parallel,
zip,
}:
let
mkLib =
name:
stdenv.mkDerivation {
pname = "kicad-${name}";
version = builtins.substring 0 10 (libSrc name).rev;
src = libSrc name;
nativeBuildInputs = [
cmake
]
++ lib.optionals (name == "packages3d") [
stepreduce
parallel
zip
];
postInstall =
lib.optionalString (name == "packages3d") ''
find $out -type f -name '*.step' | parallel 'stepreduce {} {} && zip -9 {.}.stpZ {} && rm {}'
''
+ lib.optionalString (name == "footprints") ''
grep -rl '\.step' $out | xargs sed -i 's/\.step/.stpZ/g'
'';
meta = {
license = lib.licenses.cc-by-sa-40;
platforms = lib.platforms.all;
};
};
in
{
symbols = mkLib "symbols";
templates = mkLib "templates";
footprints = mkLib "footprints";
packages3d = mkLib "packages3d";
}

View File

@@ -0,0 +1,15 @@
diff --git a/common/paths.cpp b/common/paths.cpp
index a74cdd9..790cc58 100644
--- a/common/paths.cpp
+++ b/common/paths.cpp
@@ -151,6 +151,10 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
{
wxString path;
+ if( wxGetEnv( wxT( "NIX_KICAD9_STOCK_DATA_PATH" ), &path ) ) {
+ return path;
+ }
+
if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
{
// Allow debugging from build dir by placing relevant files/folders in the build root

View File

@@ -0,0 +1,261 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils git nix curl jq nixfmt-tree
# shellcheck shell=bash enable=all
set -e
shopt -s inherit_errexit
# this script will generate versions.nix in the right location
# this should contain the versions' revs and hashes
# the stable revs are stored only for ease of skipping
# by default nix-prefetch-url uses XDG_RUNTIME_DIR as tmp
# which is /run/user/1000, which defaults to 10% of your RAM
# unless you have over 64GB of ram that'll be insufficient
# resulting in "tar: no space left on device" for packages3d
# hence:
export TMPDIR=/tmp
# if something goes unrepairably wrong, run 'update.sh all clean'
# TODO
# support parallel instances for each pname
# currently risks reusing old data
# no getting around manually checking if the build product works...
# if there is, default to commiting?
# won't work when running in parallel?
# remove items left in /nix/store?
# reuse hashes of already checked revs (to avoid redownloading testing's packages3d)
# nixpkgs' update.nix passes in UPDATE_NIX_PNAME to indicate which package is being updated
# assigning a default value to that as shellcheck doesn't like the use of unassigned variables
: "${UPDATE_NIX_PNAME:=""}"
# update.nix can also parse JSON output of this script to formulate a commit
# this requires we collect the version string in the old versions.nix for the updated package
old_version=""
new_version=""
# get the latest tag that isn't an RC or *.99
latest_tags="$(git ls-remote --tags --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
# using a scratch variable to ensure command failures get caught (SC2312)
scratch="$(grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' <<< "${latest_tags}")"
scratch="$(grep -ve '\.99' -e '\.9\.9' <<< "${scratch}")"
scratch="$(sed -n '1p' <<< "${scratch}")"
latest_tag="$(cut -d '/' -f 3 <<< "${scratch}")"
# get the latest branch name for testing
branches="$(git ls-remote --heads --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
scratch="$(grep -o 'refs/heads/[0-9]*\.[0-9]*$' <<< "${branches}")"
scratch="$(sed -n '1p' <<< "${scratch}")"
testing_branch="$(cut -d '/' -f 3 <<< "${scratch}")"
# "latest_tag" and "master" directly refer to what we want
# "testing" uses "testing_branch" found above
all_versions=( "${latest_tag}" testing master )
prefetch="nix-prefetch-url --unpack --quiet"
clean=""
check_stable=""
check_testing=1
check_unstable=1
commit=""
for arg in "$@" "${UPDATE_NIX_PNAME}"; do
case "${arg}" in
help|-h|--help) echo "Read me!" >&2; exit 1; ;;
kicad|kicad-small|release|tag|stable|5*|6*|7*|8*) check_stable=1; check_testing=""; check_unstable="" ;;
*testing|kicad-testing-small) check_testing=1; check_unstable="" ;;
*unstable|*unstable-small|master|main) check_unstable=1; check_testing="" ;;
latest|now|today) check_unstable=1; check_testing=1 ;;
all|both|full) check_stable=1; check_testing=1; check_unstable=1 ;;
clean|fix|*fuck) check_stable=1; check_testing=1; check_unstable=1; clean=1 ;;
commit) commit=1 ;;
*) ;;
esac
done
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
commit_date() {
gitlab_json="$(curl -s https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/commits/"$1")"
commit_created="$(jq .created_at --raw-output <<< "${gitlab_json}")"
date --date="${commit_created}" --iso-8601 --utc
}
file="${here}/versions.nix"
# just in case this runs in parallel
tmp="${here}/,versions.nix.${RANDOM}"
libs=( symbols templates footprints packages3d )
get_rev() {
git ls-remote "$@"
}
gitlab="https://gitlab.com/kicad"
# append commit hash or tag
src_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
lib_pre="https://gitlab.com/api/v4/projects/kicad%2Flibraries%2Fkicad-"
lib_mid="/repository/archive.tar.gz?sha="
# number of items updated
count=0
printf "Latest tag is %s\n" "${latest_tag}" >&2
if [[ ! -f ${file} ]]; then
echo "No existing file, generating from scratch" >&2
check_stable=1; check_testing=1; check_unstable=1; clean=1
fi
printf "Writing %s\n" "${tmp}" >&2
# not a dangling brace, grouping the output to redirect to file
{
printf "# This file was generated by update.sh\n\n"
printf "{\n"
for version in "${all_versions[@]}"; do
src_version=${version};
lib_version=${version};
# testing is the stable branch on the main repo
# but the libraries don't have such a branch
# only the latest release tag and a master branch
if [[ ${version} == "testing" ]]; then
src_version=${testing_branch};
lib_version=${latest_tag};
fi
if [[ ${version} == "master" ]]; then
pname="kicad-unstable"
elif [[ ${version} == "testing" ]]; then
pname="kicad-testing"
else
pname="kicad"
fi
# skip a version if we don't want to check it
if [[ (-n ${check_stable} && ${version} != "master" && ${version} != "testing") \
|| (-n ${check_testing} && ${version} == "testing") \
|| (-n ${check_unstable} && ${version} == "master" ) ]]; then
now=$(commit_date "${src_version}")
if [[ ${version} == "master" ]]; then
pname="kicad-unstable"
new_version="${now}"
elif [[ ${version} == "testing" ]]; then
pname="kicad-testing"
new_version="${testing_branch}-${now}"
else
pname="kicad"
new_version="${version}"
fi
printf "\nChecking %s\n" "${pname}" >&2
printf "%2s\"%s\" = {\n" "" "${pname}"
printf "%4skicadVersion = {\n" ""
printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
printf "%6ssrc = {\n" ""
echo "Checking src" >&2
scratch="$(get_rev "${gitlab}"/code/kicad.git "${src_version}")"
src_rev="$(cut -f1 <<< "${scratch}")"
has_rev="$(grep -sm 1 "\"${pname}\"" -A 4 "${file}" | grep -sm 1 "${src_rev}" || true)"
has_hash="$(grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "sha256" || true)"
old_version="$(grep -sm 1 "\"${pname}\"" -A 3 "${file}" | grep -sm 1 "version" | awk -F "\"" '{print $2}' || true)"
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
echo "Reusing old ${pname}.src.sha256, already latest .rev at ${old_version}" >&2
scratch=$(grep -sm 1 "\"${pname}\"" -A 5 "${file}")
grep -sm 1 "rev" -A 1 <<< "${scratch}"
else
prefetched="$(${prefetch} "${src_pre}${src_rev}")"
printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
printf "%8ssha256 =\t\t\"%s\";\n" "" "${prefetched}"
count=$((count+1))
fi
printf "%6s};\n" ""
printf "%4s};\n" ""
printf "%4slibVersion = {\n" ""
printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
printf "%6slibSources = {\n" ""
for lib in "${libs[@]}"; do
echo "Checking ${lib}" >&2
url="${gitlab}/libraries/kicad-${lib}.git"
scratch="$(get_rev "${url}" "${lib_version}")"
scratch="$(cut -f1 <<< "${scratch}")"
lib_rev="$(tail -n1 <<< "${scratch}")"
has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256" || true)"
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
echo "Reusing old kicad-${lib}-${new_version}.src.sha256, already latest .rev" >&2
scratch="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}")"
grep -sm 1 "${lib}" -A 1 <<< "${scratch}"
else
prefetched="$(${prefetch} "${lib_pre}${lib}${lib_mid}${lib_rev}")"
printf "%8s%s.rev =\t" "" "${lib}"
case "${lib}" in
symbols|templates) printf "\t" ;; *) ;;
esac
printf "\"%s\";\n" "${lib_rev}"
printf "%8s%s.sha256 =\t\"%s\";\n" "" "${lib}" "${prefetched}"
count=$((count+1))
fi
done
printf "%6s};\n" ""
printf "%4s};\n" ""
printf "%2s};\n" ""
else
printf "\nReusing old %s\n" "${pname}" >&2
grep -sm 1 "\"${pname}\"" -A 21 "${file}"
fi
done
printf "}\n"
} > "${tmp}"
if grep '""' "${tmp}"; then
echo "empty value detected, out of space?" >&2
exit "1"
fi
mv "${tmp}" "${file}"
treefmt "${file}"
printf "\nFinished\nMoved output to %s\n\n" "${file}" >&2
if [[ ${count} -gt 0 ]]; then
if [[ ${count} -gt 1 ]]; then s="s"; else s=""; fi
echo "${count} revision${s} changed" >&2
if [[ -n ${commit} ]]; then
git commit -am "$(printf "kicad: automatic update of %s item%s\n" "${count}" "${s}")"
fi
echo "Please confirm the new versions.nix works before making a PR." >&2
else
echo "No changes, those checked are up to date" >&2
fi
# using UPDATE_NIX_ATTR_PATH to detect if this is being called from update.nix
# and output JSON to describe the changes
if [[ -n ${UPDATE_NIX_ATTR_PATH} ]]; then
if [[ ${count} -eq 0 ]]; then echo "[{}]"; exit 0; fi
jq -n \
--arg attrpath "${UPDATE_NIX_PNAME}" \
--arg oldversion "${old_version}" \
--arg newversion "${new_version}" \
--arg file "${file}" \
'[{
"attrPath": $attrpath,
"oldVersion": $oldversion,
"newVersion": $newversion,
"files": [ $file ]
}]'
fi

View File

@@ -0,0 +1,70 @@
# This file was generated by update.sh
{
"kicad" = {
kicadVersion = {
version = "9.0.5";
src = {
rev = "3e59813c21b4d0a00c08978e86b5f2189ec27864";
sha256 = "0wmnkiyqv32c5nz4nvz94dld3rk5ir49nh71cycig6clvjvy11r5";
};
};
libVersion = {
version = "9.0.5";
libSources = {
symbols.rev = "884133df0afba238567e2be6c31e7d3b4a9d90be";
symbols.sha256 = "0msgq8p3zlfc3glqr1h8n0a1agk4hjdqxqdiny5b4d0hgiy6hhmx";
templates.rev = "204b42307fc78cf0b3ebec4e19eba9d710e392f4";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "873e3e9dbad8371d664e57261efa516d42328161";
footprints.sha256 = "179y7xmz7mwsfsv4dcw2dx689xfzqk8y38d21s69yiaalyxflhh1";
packages3d.rev = "c25dce5aadce68076ac035edb0c792608f5f597c";
packages3d.sha256 = "1y7yhynrr87q80gcb8qlkyrdccz1sllsxqymrnghhxbfk4wbwwn8";
};
};
};
"kicad-testing" = {
kicadVersion = {
version = "9.0-2025-02-21";
src = {
rev = "c4c32aa7bbadd3862fb720457b71e7a19420604c";
sha256 = "01zbvg6n8kajilj3q1sp0zpaqz94bq28wrxjax1968wvwv05g0dp";
};
};
libVersion = {
version = "9.0-2025-02-21";
libSources = {
symbols.rev = "e1c3371228f97b36c6fd61b66d056184930f078e";
symbols.sha256 = "0l8da2ix917jlsj6v5zclc1cb5pvjaxwmys0gjdv55ic31hhfyyw";
templates.rev = "3ed4538b0f965d821df63a5fffc4441e723cfe7f";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "ef91963f57028aa095f2d0c4239ba994ea822f73";
footprints.sha256 = "16zslgvjg4swgkkvnd9fmiks3wzg63364d03hixiyzcpjlgk2bbk";
packages3d.rev = "b40831fd7ea2ca8f9c7282143dbb7d2f5015cd69";
packages3d.sha256 = "0bg54lg1iw01gw06ajg34y7x4y36wm6ls3jnpjy13i18d4ik77g4";
};
};
};
"kicad-unstable" = {
kicadVersion = {
version = "2025-02-21";
src = {
rev = "878cf768d6552131494aa792dc20e6ccf67baf75";
sha256 = "0ky0a7y6gf409y8bwpngiirqin4ivbcjnk8gjdj1a6w79x559sr8";
};
};
libVersion = {
version = "2025-02-21";
libSources = {
symbols.rev = "da86acd48809fd61876223c8bf0e4e7793c52e9a";
symbols.sha256 = "1sdpg58wbyyrghjd0jqw5iw2094mjy2v9jmwn5zrj4jm6f51g1kd";
templates.rev = "3ed4538b0f965d821df63a5fffc4441e723cfe7f";
templates.sha256 = "0zs29zn8qjgxv0w1vyr8yxmj02m8752zagn4vcraqgik46dwg2id";
footprints.rev = "e515f1c3213317d436e492c8c06620ef4caca84e";
footprints.sha256 = "16zslgvjg4swgkkvnd9fmiks3wzg63364d03hixiyzcpjlgk2bbk";
packages3d.rev = "d5db5cea003fe2b4b1c9b145f5fcbd5fdb48f8ca";
packages3d.sha256 = "0bg54lg1iw01gw06ajg34y7x4y36wm6ls3jnpjy13i18d4ik77g4";
};
};
};
}

View File

@@ -0,0 +1,49 @@
commit 6a72fd032405515e468797be91b5a6ebcbbb5fd8
Author: Evils <evils.devils@protonmail.com>
Date: Wed Nov 23 19:49:13 2022 +0100
ensure new projects are writable
diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp
index 7ee8090858..391514519c 100644
--- a/kicad/kicad_manager_frame.cpp
+++ b/kicad/kicad_manager_frame.cpp
@@ -638,6 +638,12 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName,
// wxFFile dtor will close the file
}
+
+ if( destFileName.IsOk() && !destFileName.IsFileWritable() )
+ {
+ destFileName.SetPermissions(0644);
+ }
+
}
}
diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp
index bf951fcddb..2bef94326b 100644
--- a/kicad/project_template.cpp
+++ b/kicad/project_template.cpp
@@ -282,6 +282,21 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
result = false;
}
+ else if( !destFile.IsFileWritable() && !destFile.SetPermissions(0644) )
+ {
+ if( aErrorMsg )
+ {
+ if( !aErrorMsg->empty() )
+ *aErrorMsg += "\n";
+
+ wxString msg;
+
+ msg.Printf( _( "Cannot make file writable: '%s'." ), destFile.GetFullPath() );
+ *aErrorMsg += msg;
+ }
+
+ result = false;
+ }
}
return result;

View File

@@ -0,0 +1,61 @@
{
stdenv,
lib,
fetchFromGitHub,
qtbase,
qttools,
qtsvg,
qt5compat,
opencascade-occt,
libGLU,
cmake,
wrapQtAppsHook,
rustPlatform,
cargo,
rustc,
}:
stdenv.mkDerivation rec {
pname = "librepcb";
version = "1.3.0";
src = fetchFromGitHub {
owner = "librepcb";
repo = "librepcb";
rev = version;
hash = "sha256-J4y0ikZNuOguN9msmEQzgcY0/REnOEOoDkY/ga+Cfd8=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
qttools
qtsvg
qt5compat
wrapQtAppsHook
opencascade-occt
libGLU
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [ qtbase ];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src cargoRoot;
hash = "sha256-1td3WjxbDq2lX7c0trpYRhO82ChNAG/ZABBRsekYtq4=";
};
cargoRoot = "libs/librepcb/rust-core";
meta = with lib; {
description = "Free EDA software to develop printed circuit boards";
homepage = "https://librepcb.org/";
maintainers = with maintainers; [
luz
thoughtpolice
];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,29 @@
{
pname,
fetchurl,
lib,
}:
rec {
version = "4.3.6";
inherit pname;
src = fetchurl {
url = "mirror://sourceforge/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/${version}/linux-gpib-${version}.tar.gz";
hash = "sha256-Gze4xrvkhEgn+J5Jhrycezjp2uhlD1v6aX0WGv4J2Jg=";
};
unpackPhase = ''
tar xf $src
tar xf linux-gpib-${version}/${pname}-${version}.tar.gz
'';
sourceRoot = "${pname}-${version}";
meta = with lib; {
description = "Support package for GPIB (IEEE 488) hardware";
homepage = "https://linux-gpib.sourceforge.io/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ fsagbuya ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,30 @@
{
lib,
stdenv,
fetchurl,
kernel,
pahole,
}:
stdenv.mkDerivation (
import ./common.nix {
inherit fetchurl lib;
pname = "linux-gpib-kernel";
}
// {
postPatch = ''
sed -i 's@/sbin/depmod -A@@g' Makefile
'';
buildInputs = [ pahole ] ++ kernel.moduleBuildDependencies;
makeFlags = [
"LINUX_SRCDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
installFlags = [
"INSTALL_MOD_PATH=$(out)"
];
}
)

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
autoconf,
libtool,
bison,
flex,
automake,
udevCheckHook,
}:
stdenv.mkDerivation (
import ./common.nix {
inherit fetchurl lib;
pname = "linux-gpib-user";
}
// {
nativeBuildInputs = [
autoconf
libtool
bison
flex
automake
udevCheckHook
];
configureFlags = [
"--sysconfdir=$(out)/etc"
"--prefix=$(out)"
];
doInstallCheck = true;
}
)

View File

@@ -0,0 +1,82 @@
{
lib,
stdenv,
python3,
fetchFromGitHub,
qt6,
writeShellScriptBin,
}:
let
# Matches the pyside6-uic and pyside6-rcc implementations
# https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside-tools/pyside_tool.py?id=9b310d4c0654a244147766e382834b5e8bdeb762#n90
pyside-tools-uic = writeShellScriptBin "pyside6-uic" ''
exec ${qt6.qtbase}/libexec/uic -g python "$@"
'';
pyside-tools-rcc = writeShellScriptBin "pyside6-rcc" ''
exec ${qt6.qtbase}/libexec/rcc -g python "$@"
'';
in
python3.pkgs.buildPythonApplication rec {
pname = "nanovna-saver";
version = "0.7.3";
pyproject = true;
src = fetchFromGitHub {
owner = "NanoVNA-Saver";
repo = "nanovna-saver";
tag = "v${version}";
sha256 = "sha256-Asx4drb9W2NobdgOlbgdm1aAzB69hnIWvOM915F7sgA=";
};
nativeBuildInputs = [
qt6.wrapQtAppsHook
qt6.qtbase
];
buildInputs = lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland;
propagatedBuildInputs = with python3.pkgs; [
cython
scipy
pyqt6
pyserial
pyside6
numpy
setuptools
setuptools-scm
];
doCheck = false;
dontWrapGApps = true;
dontWrapQtApps = true;
postPatch = ''
substituteInPlace src/tools/ui_compile.py \
--replace-fail "pyside6-uic" "${pyside-tools-uic}/bin/pyside6-uic" \
--replace-fail "pyside6-rcc" "${pyside-tools-rcc}/bin/pyside6-rcc"
'';
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
"''${qtWrapperArgs[@]}"
)
'';
meta = with lib; {
homepage = "https://github.com/NanoVNA-Saver/nanovna-saver";
description = "Tool for reading, displaying and saving data from the NanoVNA";
mainProgram = "NanoVNASaver";
longDescription = ''
A multiplatform tool to save Touchstone files from the NanoVNA, sweep
frequency spans in segments to gain more than 101 data points, and
generally display and analyze the resulting data.
'';
license = licenses.gpl3Only;
maintainers = with maintainers; [
zaninime
tmarkus
];
};
}

View File

@@ -0,0 +1,54 @@
{
mkDerivation,
lib,
fetchFromGitHub,
makeWrapper,
cmake,
qtbase,
qttools,
fftw,
libusb1,
libglvnd,
}:
mkDerivation rec {
pname = "openhantek6022";
version = "3.4.0";
src = fetchFromGitHub {
owner = "OpenHantek";
repo = "OpenHantek6022";
rev = version;
sha256 = "sha256-FT+DyfD5WHBblRXWXFnyB2xwoIgoh84oB+QN32wx78c=";
};
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
fftw
libusb1
libglvnd
qtbase
qttools
];
postPatch = ''
# Fix up install paths & checks
sed -i 's#if(EXISTS ".*")#if(1)#g' CMakeLists.txt
sed -i 's#/lib/udev#lib/udev#g' CMakeLists.txt
sed -i 's#/usr/share#share#g' CMakeLists.txt
'';
doInstallCheck = true;
meta = with lib; {
description = "Free software for Hantek and compatible (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes";
mainProgram = "OpenHantek";
homepage = "https://github.com/OpenHantek/OpenHantek6022";
license = licenses.gpl3;
maintainers = with maintainers; [ baracoder ];
platforms = qtbase.meta.platforms;
};
}

View File

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
glib,
boost,
libsigrok,
libsigrokdecode,
libserialport,
libzip,
libftdi1,
hidapi,
glibmm,
pcre,
python3,
qtsvg,
qttools,
bluez,
wrapQtAppsHook,
desktopToDarwinBundle,
}:
stdenv.mkDerivation {
pname = "pulseview";
version = "0.4.2-unstable-2025-05-15";
src = fetchFromGitHub {
owner = "sigrokproject";
repo = "pulseview";
rev = "e2fe9dfb91c7de85c410922ee9268c3f526bcc54";
hash = "sha256-b9pqtsF5J9MA7XMIgFZltrVqi64ZPObBTiaws3zSDRg=";
};
nativeBuildInputs = [
cmake
pkg-config
qttools
wrapQtAppsHook
]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
glib
boost
libsigrok
libsigrokdecode
libserialport
libzip
libftdi1
hidapi
glibmm
pcre
python3
qtsvg
]
++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ];
meta = with lib; {
description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)";
mainProgram = "pulseview";
homepage = "https://sigrok.org/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [
bjornfor
vifino
];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchurl,
rsync,
ocamlPackages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "abella";
version = "2.0.8";
src = fetchurl {
url = "http://abella-prover.org/distributions/abella-${finalAttrs.version}.tar.gz";
sha256 = "sha256-80b/RUpE3KRY0Qu8eeTxAbk6mwGG6jVTPOP0qFjyj2M=";
};
strictDeps = true;
nativeBuildInputs = [
rsync
]
++ (with ocamlPackages; [
ocaml
dune_3
menhir
findlib
]);
buildInputs = with ocamlPackages; [
cmdliner
yojson
];
installPhase = ''
mkdir -p $out/bin
rsync -av _build/default/src/abella.exe $out/bin/abella
mkdir -p $out/share/emacs/site-lisp/abella/
rsync -av emacs/ $out/share/emacs/site-lisp/abella/
mkdir -p $out/share/abella/examples
rsync -av examples/ $out/share/abella/examples/
'';
meta = {
description = "Interactive theorem prover";
mainProgram = "abella";
longDescription = ''
Abella is an interactive theorem prover based on lambda-tree syntax.
This means that Abella is well-suited for reasoning about the meta-theory
of programming languages and other logical systems which manipulate
objects with binding.
'';
homepage = "https://abella-prover.org";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [
bcdarwin
ciil
];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,31 @@
From 563f023aba1034f4f433f412302b825b059ef5a5 Mon Sep 17 00:00:00 2001
From: Mark Barbone <mark.l.barbone@gmail.com>
Date: Sun, 19 Jul 2020 17:24:30 -0400
Subject: [PATCH] Fix to-string.agda to compile with Agda 2.6.1
---
Adapted from https://github.com/cedille/cedille/pull/156.
src/to-string.agda | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/to-string.agda b/src/to-string.agda
index 2505942..051a2da 100644
--- a/src/to-string.agda
+++ b/src/to-string.agda
@@ -100,9 +100,9 @@ no-parens {TK} _ _ _ = tt
no-parens {QUALIF} _ _ _ = tt
no-parens {ARG} _ _ _ = tt
-pattern ced-ops-drop-spine = cedille-options.options.mk-options _ _ _ _ ff _ _ _ ff _
-pattern ced-ops-conv-arr = cedille-options.options.mk-options _ _ _ _ _ _ _ _ ff _
-pattern ced-ops-conv-abs = cedille-options.options.mk-options _ _ _ _ _ _ _ _ tt _
+pattern ced-ops-drop-spine = cedille-options.mk-options _ _ _ _ ff _ _ _ ff _
+pattern ced-ops-conv-arr = cedille-options.mk-options _ _ _ _ _ _ _ _ ff _
+pattern ced-ops-conv-abs = cedille-options.mk-options _ _ _ _ _ _ _ _ tt _
drop-spine : cedille-options.options → {ed : exprd} → ctxt → ⟦ ed ⟧ → ⟦ ed ⟧
drop-spine ops @ ced-ops-drop-spine = h
--
2.27.0

View File

@@ -0,0 +1,67 @@
{
stdenv,
lib,
fetchFromGitHub,
alex,
happy,
Agda,
buildPackages,
ghcWithPackages,
}:
stdenv.mkDerivation rec {
version = "1.1.2";
pname = "cedille";
src = fetchFromGitHub {
owner = "cedille";
repo = "cedille";
rev = "v${version}";
sha256 = "1j745q9sd32fhcb96wjq6xvyqq1k6imppjnya6x0n99fyfnqzvg9";
fetchSubmodules = true;
};
patches = [
./Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch
];
nativeBuildInputs = [
alex
happy
];
buildInputs = [
Agda
(ghcWithPackages (ps: [ ps.ieee ]))
];
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = lib.optionalString (
stdenv.buildPlatform.libc == "glibc"
) "${buildPackages.glibcLocales}/lib/locale/locale-archive";
postPatch = ''
patchShebangs create-libraries.sh
'';
installPhase = ''
install -Dm755 -t $out/bin/ cedille
install -Dm755 -t $out/bin/ core/cedille-core
install -Dm644 -t $out/share/info docs/info/cedille-info-main.info
mkdir -p $out/lib/
cp -r lib/ $out/lib/cedille/
'';
meta = with lib; {
description = "Interactive theorem-prover and dependently typed programming language, based on extrinsic (aka Curry-style) type theory";
homepage = "https://cedille.github.io/";
license = licenses.mit;
maintainers = with maintainers; [ mpickering ];
platforms = platforms.unix;
# Broken due to Agda update. See
# https://github.com/NixOS/nixpkgs/pull/129606#issuecomment-881107449.
broken = true;
hydraPlatforms = platforms.none;
};
}

View File

@@ -0,0 +1,363 @@
# - coqide compilation can be disabled by setting buildIde to false
# - The csdp program used for the Micromega tactic is statically referenced.
# However, coq can build without csdp by setting it to null.
# In this case some Micromega tactics will search the user's path for the csdp program and will fail if it is not found.
# - The exact version can be specified through the `version` argument to
# the derivation; it defaults to the latest stable version.
{
lib,
stdenv,
fetchzip,
fetchurl,
writeText,
pkg-config,
gnumake42,
customOCamlPackages ? null,
ocamlPackages_4_09,
ocamlPackages_4_10,
ocamlPackages_4_12,
ocamlPackages_4_14,
rocqPackages, # for versions >= 9.0 that are transition shims on top of Rocq
ncurses,
buildIde ? null, # default is true for Coq < 8.14 and false for Coq >= 8.14
glib,
adwaita-icon-theme,
wrapGAppsHook3,
makeDesktopItem,
copyDesktopItems,
csdp ? null,
version,
coq-version ? null,
}@args:
let
lib = import ../../../../build-support/coq/extra-lib.nix { inherit (args) lib; };
release = {
"8.7.0".sha256 = "1h18b7xpnx3ix9vsi5fx4zdcbxy7bhra7gd5c5yzxmk53cgf1p9m";
"8.7.1".sha256 = "0gjn59jkbxwrihk8fx9d823wjyjh5m9gvj9l31nv6z6bcqhgdqi8";
"8.7.2".sha256 = "0a0657xby8wdq4aqb2xsxp3n7pmc2w4yxjmrb2l4kccs1aqvaj4w";
"8.8.0".sha256 = "13a4fka22hdxsjk11mgjb9ffzplfxyxp1sg5v1c8nk1grxlscgw8";
"8.8.1".sha256 = "1hlf58gwazywbmfa48219amid38vqdl94yz21i11b4map6jfwhbk";
"8.8.2".sha256 = "1lip3xja924dm6qblisk1bk0x8ai24s5xxqxphbdxj6djglj68fd";
"8.9.0".sha256 = "1dkgdjc4n1m15m1p724hhi5cyxpqbjw6rxc5na6fl3v4qjjfnizh";
"8.9.1".sha256 = "1xrq6mkhpq994bncmnijf8jwmwn961kkpl4mwwlv7j3dgnysrcv2";
"8.10.0".sha256 = "138jw94wp4mg5dgjc2asn8ng09ayz1mxdznq342n0m469j803gzg";
"8.10.1".sha256 = "072v2zkjzf7gj48137wpr3c9j0hg9pdhlr5l8jrgrwynld8fp7i4";
"8.10.2".sha256 = "0znxmpy71bfw0p6x47i82jf5k7v41zbz9bdpn901ysn3ir8l3wrz";
"8.11.0".sha256 = "1rfdic6mp7acx2zfwz7ziqk12g95bl9nyj68z4n20a5bcjv2pxpn";
"8.11.1".sha256 = "0qriy9dy36dajsv5qmli8gd6v55mah02ya334nw49ky19v7518m0";
"8.11.2".sha256 = "0f77ccyxdgbf1nrj5fa8qvrk1cyfy06fv8gj9kzfvlcgn0cf48sa";
"8.12.0".sha256 = "18dc7k0piv6v064zgdadpw6mkkxk7j663hb3svgj5236fihjr0cz";
"8.12.1".sha256 = "1rkcyjjrzcqw9xk93hsq0vvji4f8r5iq0f739mghk60bghkpnb7q";
"8.12.2".sha256 = "18gscfm039pqhq4msq01nraig5dm9ab98bjca94zldf8jvdv0x2n";
"8.13.0".sha256 = "1l2c63vskp8kiyxiyi5rpgbmnv67ysn3y4lybd6nj0li5llibifi";
"8.13.1".sha256 = "15drjcqhsgwqnv02bbidyhk316ypyhz1pxfz2gwsalci9svhkz0v";
"8.13.2".sha256 = "14d4alp35hngvga9m7cfp5d1nl62xdj0nm4811f2jjblk86gxxk4";
"8.14.0".sha256 = "0yxjx9kq9bfpk31dc1c6a0pz0827fz7jmrcwwd4n7dc07yi0arq8";
"8.14.1".sha256 = "0xdqiabgm4lrm6d7lw544zd8xwb1cdcavsxvwwlqq6yid2rl2yli";
"8.15.0".sha256 = "sha256:0q7jl3bn0d1v9cwdkxykw4frccww6wbh1p8hdrfqw489mkxmh5jh";
"8.15.1".sha256 = "sha256:1janvmnk3czimp0j5qmnfwx6509vhpjc2q7lcza1bc6dm6kn8n42";
"8.15.2".sha256 = "sha256:0qibbvzrhsvs6w3zpkhyclndp29jnr6bs9i5skjlpp431jdjjfqd";
"8.16.0".sha256 = "sha256-3V6kL9j2rn5FHBxq1mtmWWTZS9X5cAyvtUsS6DaM+is=";
"8.16.1".sha256 = "sha256-n7830+zfZeyYHEOGdUo57bH6bb2/SZs8zv8xJhV+iAc=";
"8.17.0".sha256 = "sha256-TGwm7S6+vkeZ8cidvp8pkiAd9tk008jvvPvYgfEOXhM=";
"8.17.1".sha256 = "sha256-x+RwkbxMg9aR0L3WSCtpIz8jwA5cJA4tXAtHMZb20y4=";
"8.18.0".sha256 = "sha256-WhiBs4nzPHQ0R24xAdM49kmxSCPOxiOVMA1iiMYunz4=";
"8.19.0".sha256 = "sha256-ixsYCvCXpBHqJ71hLQklphlwoOO3i/6w2PJjllKqf9k=";
"8.19.1".sha256 = "sha256-kmZ8Uk8jpzjOd67aAPp3C+vU2oNaBw9pr7+Uixcgg94=";
"8.19.2".sha256 = "sha256-q+i07JsMZp83Gqav6v1jxsgPLN7sPvp5/oszVnavmz0=";
"8.20.0".sha256 = "sha256-WFpZlA6CzFVAruPhWcHQI7VOBVhrGLdFzWrHW0DTSl0=";
"8.20.1".sha256 = "sha256-nRaLODPG4E3gUDzGrCK40vhl4+VhPyd+/fXFK/HC3Ig=";
"9.0.0".sha256 = "sha256-GRwYSvrJGiPD+I82gLOgotb+8Ra5xHZUJGcNwxWqZkU=";
"9.1.0".sha256 = "sha256-+QL7I1/0BfT87n7lSaOmpHj2jJuDB4idWhAxwzvVQOE=";
};
releaseRev = v: "V${v}";
fetched =
import ../../../../build-support/coq/meta-fetch/default.nix
{
inherit
lib
stdenv
fetchzip
fetchurl
;
}
{
inherit release releaseRev;
location = {
owner = "coq";
repo = "coq";
};
}
args.version;
version = fetched.version;
coq-version =
args.coq-version or (if version != "dev" then lib.versions.majorMinor version else "dev");
coqAtLeast = v: coq-version == "dev" || lib.versionAtLeast coq-version v;
buildIde = args.buildIde or (!coqAtLeast "8.14");
ideFlags = lib.optionalString (
buildIde && !coqAtLeast "8.10"
) "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt";
csdpPatch = lib.optionalString (csdp != null) ''
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
'';
ocamlPackages =
if customOCamlPackages != null then
customOCamlPackages
else
lib.switch coq-version [
{
case = lib.versions.range "8.16" "8.18";
out = ocamlPackages_4_14;
}
{
case = lib.versions.range "8.14" "8.15";
out = ocamlPackages_4_12;
}
{
case = lib.versions.range "8.11" "8.13";
out = ocamlPackages_4_10;
}
{
case = lib.versions.range "8.7" "8.10";
out = ocamlPackages_4_09;
}
] ocamlPackages_4_14;
ocamlNativeBuildInputs = [
ocamlPackages.ocaml
ocamlPackages.findlib
]
++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3;
ocamlPropagatedBuildInputs =
[ ]
++ lib.optional (!coqAtLeast "8.10") ocamlPackages.camlp5
++ lib.optional (!coqAtLeast "8.13") ocamlPackages.num
++ lib.optional (coqAtLeast "8.13") ocamlPackages.zarith;
self = stdenv.mkDerivation {
pname = "coq";
inherit (fetched) version src;
passthru = {
inherit coq-version;
inherit ocamlPackages ocamlNativeBuildInputs;
inherit ocamlPropagatedBuildInputs;
# For compatibility
inherit (ocamlPackages)
ocaml
camlp5
findlib
num
;
rocqPackages = lib.optionalAttrs (coqAtLeast "8.21") rocqPackages;
emacsBufferSetup = pkgs: ''
; Propagate coq paths to children
(inherit-local-permanent coq-prog-name "${self}/bin/coqtop")
(inherit-local-permanent coq-dependency-analyzer "${self}/bin/coqdep")
(inherit-local-permanent coq-compiler "${self}/bin/coqc")
; If the coq-library path was already set, re-set it based on our current coq
(when (fboundp 'get-coq-library-directory)
(inherit-local-permanent coq-library-directory (get-coq-library-directory))
(coq-prog-args))
(mapc (lambda (arg)
(when (file-directory-p (concat arg "/lib/coq/${coq-version}/user-contrib"))
(setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${
lib.concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)
}))
; TODO Abstract this pattern from here and nixBufferBuilders.withPackages!
(defvar nixpkgs--coq-buffer-count 0)
(when (eq nixpkgs--coq-buffer-count 0)
(make-variable-buffer-local 'nixpkgs--is-nixpkgs-coq-buffer)
(defun nixpkgs--coq-inherit (buf)
(inherit-local-inherit-child buf)
(with-current-buffer buf
(setq nixpkgs--coq-buffer-count (1+ nixpkgs--coq-buffer-count))
(add-hook 'kill-buffer-hook 'nixpkgs--decrement-coq-buffer-count nil t))
buf)
; When generating a scomint buffer, do inherit-local inheritance and make it a nixpkgs-coq buffer
(defun nixpkgs--around-scomint-make (orig &rest r)
(if nixpkgs--is-nixpkgs-coq-buffer
(progn
(advice-add 'get-buffer-create :filter-return #'nixpkgs--coq-inherit)
(apply orig r)
(advice-remove 'get-buffer-create #'nixpkgs--coq-inherit))
(apply orig r)))
(advice-add 'scomint-make :around #'nixpkgs--around-scomint-make)
; When we have no more coq buffers, tear down the buffer handling
(defun nixpkgs--decrement-coq-buffer-count ()
(setq nixpkgs--coq-buffer-count (1- nixpkgs--coq-buffer-count))
(when (eq nixpkgs--coq-buffer-count 0)
(advice-remove 'scomint-make #'nixpkgs--around-scomint-make)
(fmakunbound 'nixpkgs--around-scomint-make)
(fmakunbound 'nixpkgs--coq-inherit)
(fmakunbound 'nixpkgs--decrement-coq-buffer-count))))
(setq nixpkgs--coq-buffer-count (1+ nixpkgs--coq-buffer-count))
(add-hook 'kill-buffer-hook 'nixpkgs--decrement-coq-buffer-count nil t)
(setq nixpkgs--is-nixpkgs-coq-buffer t)
(inherit-local 'nixpkgs--is-nixpkgs-coq-buffer)
'';
};
nativeBuildInputs = [
pkg-config
]
++ ocamlNativeBuildInputs
++ lib.optional buildIde copyDesktopItems
++ lib.optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3
++ lib.optional (!coqAtLeast "8.6") gnumake42;
buildInputs = [
ncurses
]
++ lib.optionals buildIde (
if coqAtLeast "8.10" then
[
ocamlPackages.lablgtk3-sourceview3
glib
adwaita-icon-theme
]
else
[ ocamlPackages.lablgtk ]
);
propagatedBuildInputs = ocamlPropagatedBuildInputs;
postPatch = ''
UNAME=$(type -tp uname)
RM=$(type -tp rm)
substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
${lib.optionalString (
!coqAtLeast "8.7"
) "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\""}
${csdpPatch}
'';
setupHook = writeText "setupHook.sh" ''
addCoqPath () {
if test -d "''$1/lib/coq/${coq-version}/user-contrib"; then
export COQPATH="''${COQPATH-}''${COQPATH:+:}''$1/lib/coq/${coq-version}/user-contrib/"
fi
}
addEnvHooks "$targetOffset" addCoqPath
'';
preConfigure =
if coqAtLeast "8.10" then
''
patchShebangs dev/tools/
''
else
''
configureFlagsArray=(
${ideFlags}
)
'';
prefixKey = "-prefix ";
buildFlags = [
"revision"
"coq"
]
++ lib.optional buildIde "coqide"
++ lib.optional (!coqAtLeast "8.14") "bin/votour";
enableParallelBuilding = true;
createFindlibDestdir = true;
desktopItems = lib.optional buildIde (makeDesktopItem {
name = "coqide";
exec = "coqide";
icon = "coq";
desktopName = "CoqIDE";
comment = "Graphical interface for the Coq proof assistant";
categories = [
"Development"
"Science"
"Math"
"IDE"
"GTK"
];
});
postInstall =
let
suffix = lib.optionalString (coqAtLeast "8.14") "-core";
in
lib.optionalString (!coqAtLeast "8.17") ''
cp bin/votour $out/bin/
''
+ ''
ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix}
''
+ lib.optionalString (coqAtLeast "8.14") ''
ln -s $out/lib/coqide-server $OCAMLFIND_DESTDIR/coqide-server
''
+ lib.optionalString buildIde ''
mkdir -p "$out/share/pixmaps"
ln -s "$out/share/coq/coq.png" "$out/share/pixmaps/"
'';
meta = with lib; {
description = "Coq proof assistant";
longDescription = ''
Coq is a formal proof management system. It provides a formal language
to write mathematical definitions, executable algorithms and theorems
together with an environment for semi-interactive development of
machine-checked proofs.
'';
homepage = "https://coq.inria.fr";
license = licenses.lgpl21;
branch = coq-version;
maintainers = with maintainers; [
roconnor
thoughtpolice
vbgl
Zimmi48
];
platforms = platforms.unix;
mainProgram = "coqide";
};
};
in
if coqAtLeast "8.21" then
self.overrideAttrs (o: {
# coq-core is now a shim for rocq
propagatedBuildInputs = o.propagatedBuildInputs ++ [
rocqPackages.rocq-core
];
buildPhase = ''
runHook preBuild
dune build -p coq-core,coqide-server${lib.optionalString buildIde ",rocqide"} -j $NIX_BUILD_CORES
runHook postBuild
'';
installPhase = ''
runHook preInstall
dune install --prefix $out coq-core coqide-server${lib.optionalString buildIde " rocqide"}
# coq and rocq are now in different directories, which sometimes confuses coq_makefile
# which expects both in the same /nix/store/.../bin/ directory
# adding symlinks to content it
ROCQBIN=$(dirname ''$(command -v rocq))
for b in csdpcert ocamllibdep rocq rocq.byte rocqchk votour ; do
ln -s ''${ROCQBIN}/''${b} $out/bin/
done
runHook postInstall
'';
})
else if coqAtLeast "8.17" then
self.overrideAttrs (_: {
buildPhase = ''
runHook preBuild
make dunestrap
dune build -p coq-core,coq-stdlib,coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES
runHook postBuild
'';
installPhase = ''
runHook preInstall
dune install --prefix $out coq-core coq-stdlib coqide-server${lib.optionalString buildIde " coqide"}
runHook postInstall
'';
})
else
self

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchurl,
autoreconfHook,
which,
ocamlPackages,
}:
stdenv.mkDerivation rec {
pname = "cubicle";
version = "1.2.0";
src = fetchurl {
url = "https://github.com/cubicle-model-checker/cubicle/archive/refs/tags/${version}.tar.gz";
hash = "sha256-/EtbXpyXqRm0jGcMfGLAEwdr92061edjFys1V7/w6/Y=";
};
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
which
]
++ (with ocamlPackages; [
findlib
ocaml
]);
buildInputs = with ocamlPackages; [
functory
num
];
# https://github.com/cubicle-model-checker/cubicle/issues/1
env = {
OCAMLC = "ocamlfind ocamlc -package num";
OCAMLOPT = "ocamlfind ocamlopt -package num";
};
meta = with lib; {
description = "Open source model checker for verifying safety properties of array-based systems";
mainProgram = "cubicle";
homepage = "https://cubicle.lri.fr/";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ dwarfmaster ];
};
}

View File

@@ -0,0 +1,76 @@
commit 4eb28b907e89be05d92eb704115f821b9b848e60
Author: Matthew Dawson <matthew@mjdsystems.ca>
Date: Sun Oct 16 22:06:03 2016 -0400
Fix gcc v6 compile failures.
* Use std::hash<const char*> over std::hash<char *>, as throwing away the const is not allowed.
* Use Hash::hash by default in CDMap over std::hash, to get Hash::hash<CVC3::expr>
diff --git a/src/expr/expr_value.cpp b/src/expr/expr_value.cpp
index 0c85ff6..e4dd251 100644
--- a/src/expr/expr_value.cpp
+++ b/src/expr/expr_value.cpp
@@ -29,7 +29,7 @@ namespace CVC3 {
// Class ExprValue static members
////////////////////////////////////////////////////////////////////////
-std::hash<char*> ExprValue::s_charHash;
+std::hash<const char*> ExprValue::s_charHash;
std::hash<long int> ExprValue::s_intHash;
////////////////////////////////////////////////////////////////////////
diff --git a/src/include/cdmap.h b/src/include/cdmap.h
index faf682a..c3b094c 100644
--- a/src/include/cdmap.h
+++ b/src/include/cdmap.h
@@ -43,9 +43,9 @@ namespace CVC3 {
// Auxiliary class: almost the same as CDO (see cdo.h), but on
// setNull() call it erases itself from the map.
-template <class Key, class Data, class HashFcn = std::hash<Key> > class CDMap;
+template <class Key, class Data, class HashFcn = Hash::hash<Key> > class CDMap;
-template <class Key, class Data, class HashFcn = std::hash<Key> >
+template <class Key, class Data, class HashFcn = Hash::hash<Key> >
class CDOmap :public ContextObj {
Key d_key;
Data d_data;
diff --git a/src/include/expr_hash.h b/src/include/expr_hash.h
index b2107d7..baa2eab 100644
--- a/src/include/expr_hash.h
+++ b/src/include/expr_hash.h
@@ -20,7 +20,6 @@
* hash_set over Expr class.
*/
/*****************************************************************************/
-
#ifndef _cvc3__expr_h_
#include "expr.h"
#endif
diff --git a/src/include/expr_value.h b/src/include/expr_value.h
index 95102b2..f53aa4d 100644
--- a/src/include/expr_value.h
+++ b/src/include/expr_value.h
@@ -179,7 +179,7 @@ protected:
// Static hash functions. They don't depend on the context
// (ExprManager and such), so it is still thread-safe to have them
// static.
- static std::hash<char*> s_charHash;
+ static std::hash<const char*> s_charHash;
static std::hash<long int> s_intHash;
static size_t pointerHash(void* p) { return s_intHash((long int)p); }
diff --git a/src/theory_core/theory_core.cpp b/src/theory_core/theory_core.cpp
index df5289f..37ccab9 100644
--- a/src/theory_core/theory_core.cpp
+++ b/src/theory_core/theory_core.cpp
@@ -710,7 +710,7 @@ TheoryCore::TheoryCore(ContextManager* cm,
// d_termTheorems(cm->getCurrentContext()),
d_predicates(cm->getCurrentContext()),
d_solver(NULL),
- d_simplifyInPlace(false),
+ d_simplifyInPlace(NULL),
d_currentRecursiveSimplifier(NULL),
d_resourceLimit(0),
d_timeBase(0),

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchurl,
flex,
bison,
gmp,
perl,
}:
stdenv.mkDerivation rec {
pname = "cvc3";
version = "2.4.1";
src = fetchurl {
url = "https://cs.nyu.edu/acsys/cvc3/releases/${version}/${pname}-${version}.tar.gz";
sha256 = "1xxcwhz3y6djrycw8sm6xz83wb4hb12rd1n0skvc7fng0rh1snym";
};
buildInputs = [
gmp
flex
bison
perl
];
patches = [ ./cvc3-2.4.1-gccv6-fix.patch ];
# fails to configure on darwin due to gmp not found
configureFlags = [
"LIBS=-L${gmp}/lib"
"CXXFLAGS=-I${gmp.dev}/include"
];
postPatch = ''
sed -e "s@ /bin/bash@bash@g" -i Makefile.std
find . -exec sed -e "s@/usr/bin/perl@${perl}/bin/perl@g" -i '{}' ';'
# bison 3.7 workaround
for f in parsePL parseLisp parsesmtlib parsesmtlib2 ; do
ln -s ../parser/''${f}_defs.h src/include/''${f}.hpp
done
'';
meta = with lib; {
description = "Prover for satisfiability modulo theory (SMT)";
mainProgram = "cvc3";
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
license = licenses.free;
homepage = "https://cs.nyu.edu/acsys/cvc3/index.html";
};
passthru = {
updateInfo = {
downloadPage = "https://cs.nyu.edu/acsys/cvc3/download.html";
};
};
}

View File

@@ -0,0 +1,69 @@
{
lib,
stdenv,
darwin,
fetchFromGitHub,
ocamlPackages,
why3,
python3,
}:
stdenv.mkDerivation rec {
pname = "easycrypt";
version = "2025.08";
src = fetchFromGitHub {
owner = "easycrypt";
repo = "easycrypt";
tag = "r${version}";
hash = "sha256-WUms6hh7T5/gxRLFvbJQiT1ErLr8KFilFNOMTT/fIyY=";
};
nativeBuildInputs =
with ocamlPackages;
[
dune_3
findlib
menhir
ocaml
python3.pkgs.wrapPython
]
++ lib.optional stdenv.hostPlatform.isDarwin darwin.sigtool;
buildInputs = with ocamlPackages; [
batteries
dune-build-info
dune-site
inifiles
why3
yojson
zarith
];
propagatedBuildInputs = [ why3.out ];
strictDeps = true;
postPatch = ''
substituteInPlace dune-project --replace-fail '(name easycrypt)' '(name easycrypt)(version ${version})'
'';
pythonPath = with python3.pkgs; [ pyyaml ];
installPhase = ''
runHook preInstall
dune install --prefix $out easycrypt
rm $out/bin/ec-runtest
wrapPythonProgramsIn "$out/lib/easycrypt/commands" "$pythonPath"
runHook postInstall
'';
meta = {
license = lib.licenses.mit;
maintainers = [ lib.maintainers.vbgl ];
platforms = lib.platforms.all;
homepage = "https://easycrypt.info/";
description = "Computer-Aided Cryptographic Proofs";
mainProgram = "easycrypt";
};
}

View File

@@ -0,0 +1,26 @@
{ python3Packages, easycrypt }:
python3Packages.buildPythonApplication {
inherit (easycrypt) src version;
format = "other";
pname = "easycrypt-runtest";
dontConfigure = true;
dontBuild = true;
doCheck = false;
pythonPath = with python3Packages; [ pyyaml ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp scripts/testing/runtest $out/bin/ec-runtest
runHook postInstall
'';
meta = easycrypt.meta // {
description = "Testing program for EasyCrypt formalizations";
mainProgram = "ec-runtest";
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchurl,
ocaml,
perl,
}:
stdenv.mkDerivation rec {
pname = "ekrhyper";
version = "1_4_21022014";
src = fetchurl {
url = "http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_${version}.tar.gz";
sha256 = "sha256-fEe0DIMGj7wO+79/BZf45kykgyTXpbZJsyFSt31XqpM=";
};
strictDeps = true;
nativeBuildInputs = [
ocaml
perl
];
setSourceRoot = "export sourceRoot=$(echo */ekrh/src)";
preInstall = "export INSTALLDIR=$out";
postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';
meta = with lib; {
description = "Automated first-order theorem prover";
license = licenses.gpl2;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,66 @@
From: Stephane Glondu <steph@glondu.net>
Date: Wed, 12 Feb 2020 05:42:32 +0100
Subject: Fix compilation with camlp5 7.11
---
pa_j_4.xx_7.xx.ml | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/pa_j_4.xx_7.xx.ml b/pa_j_4.xx_7.xx.ml
index 4f7ed60..e834058 100755
--- a/pa_j/pa_j_4.xx_7.xx.ml
+++ b/pa_j/pa_j_4.xx_7.xx.ml
@@ -410,9 +410,10 @@ and reloc_module_type floc sh =
| MtApp loc x1 x2 →
let loc = floc loc in
MtApp loc (self x1) (self x2)
- | MtFun loc x1 x2 x3 →
+ | MtFun loc x x3 →
let loc = floc loc in
- MtFun loc x1 (self x2) (self x3)
+ let x = vala_map (option_map (fun (x1, x2) -> (x1, self x2))) x in
+ MtFun loc x (self x3)
| MtLid loc x1 →
let loc = floc loc in
MtLid loc x1
@@ -507,9 +508,10 @@ and reloc_module_expr floc sh =
| MeApp loc x1 x2 →
let loc = floc loc in
MeApp loc (self x1) (self x2)
- | MeFun loc x1 x2 x3 →
+ | MeFun loc x x3 →
let loc = floc loc in
- MeFun loc x1 (reloc_module_type floc sh x2) (self x3)
+ let x = vala_map (option_map (fun (x1, x2) -> (x1, reloc_module_type floc sh x2))) x in
+ MeFun loc x (self x3)
| MeStr loc x1 →
let loc = floc loc in
MeStr loc (vala_map (List.map (reloc_str_item floc sh)) x1)
@@ -2007,7 +2009,7 @@ EXTEND
| -> <:vala< [] >> ] ]
;
mod_binding:
- [ [ i = V UIDENT; me = mod_fun_binding -> (i, me) ] ]
+ [ [ i = V uidopt "uidopt"; me = mod_fun_binding -> (i, me) ] ]
;
mod_fun_binding:
[ RIGHTA
@@ -2070,7 +2072,7 @@ EXTEND
<:sig_item< value $lid:i$ : $t$ >> ] ]
;
mod_decl_binding:
- [ [ i = V UIDENT; mt = module_declaration -> (i, mt) ] ]
+ [ [ i = V uidopt "uidopt"; mt = module_declaration -> (i, mt) ] ]
;
module_declaration:
[ RIGHTA
@@ -2092,6 +2094,9 @@ EXTEND
| "module"; i = V mod_ident ""; ":="; me = module_expr ->
<:with_constr< module $_:i$ := $me$ >> ] ]
;
+ uidopt:
+ [ [ m = V UIDENT -> Some m ] ]
+ ;
(* Core expressions *)
expr:
[ "top" RIGHTA

View File

@@ -0,0 +1,85 @@
{
lib,
stdenv,
runtimeShell,
fetchFromGitHub,
ocaml,
findlib,
num,
zarith,
camlp5,
camlp-streams,
}:
let
use_zarith = lib.versionAtLeast ocaml.version "4.14";
load_num =
if use_zarith then
''
-I ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith \
-I ${zarith}/lib/ocaml/${ocaml.version}/site-lib/stublibs \
''
else
lib.optionalString (num != null) ''
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/num \
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/top-num \
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/stublibs \
'';
start_script = ''
#!${runtimeShell}
cd $out/lib/hol_light
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}${camlp5}/lib/ocaml/${ocaml.version}/site-lib/"
exec ${ocaml}/bin/ocaml \
-I \`${camlp5}/bin/camlp5 -where\` \
${load_num} \
-I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ \
-I ${camlp-streams}/lib/ocaml/${ocaml.version}/site-lib/camlp-streams camlp_streams.cma \
-init make.ml
'';
in
stdenv.mkDerivation {
pname = "hol_light";
version = "unstable-2024-07-07";
src = fetchFromGitHub {
owner = "jrh13";
repo = "hol-light";
rev = "16b184e30e7e3fe9add7d1ee93242323ed2e1726";
hash = "sha256-V0OtsmX5pa+CH3ZXmNG3juXwXZ5+A0k13eMCAfaRziQ=";
};
patches = [ ./0004-Fix-compilation-with-camlp5-7.11.patch ];
strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
camlp5
];
propagatedBuildInputs = [
camlp-streams
(if use_zarith then zarith else num)
];
installPhase = ''
mkdir -p "$out/lib/hol_light" "$out/bin"
cp -a . $out/lib/hol_light
echo "${start_script}" > "$out/bin/hol_light"
chmod a+x "$out/bin/hol_light"
'';
meta = with lib; {
description = "Interactive theorem prover based on Higher-Order Logic";
homepage = "http://www.cl.cam.ac.uk/~jrh13/hol-light/";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = with maintainers; [
thoughtpolice
maggesi
vbgl
];
};
}

View File

@@ -0,0 +1,281 @@
{
lib,
llvmPackages,
callPackage,
fetchFromGitHub,
cmake,
python3,
z3,
stp,
cryptominisat,
gperftools,
sqlite,
gtest,
lit,
nix-update-script,
# Build KLEE in debug mode. Defaults to false.
debug ? false,
# Include debug info in the build. Defaults to true.
includeDebugInfo ? true,
# Enable KLEE asserts. Defaults to true, since LLVM is built with them.
asserts ? false,
# Build the KLEE runtime in debug mode. Defaults to true, as this improves
# stack traces of the software under test.
debugRuntime ? true,
# Enable runtime asserts. Default false.
runtimeAsserts ? false,
# Klee uclibc. Defaults to the bundled version.
kleeuClibc ? null,
# Extra klee-uclibc config for the default klee-uclibc.
extraKleeuClibcConfig ? { },
}:
let
# The chosen version of klee-uclibc.
chosenKleeuClibc =
if kleeuClibc == null then
callPackage ./klee-uclibc.nix {
llvmPackages = llvmPackages;
inherit extraKleeuClibcConfig debugRuntime runtimeAsserts;
}
else
kleeuClibc;
# Python used for KLEE tests.
kleePython = python3.withPackages (ps: with ps; [ tabulate ]);
in
llvmPackages.stdenv.mkDerivation {
pname = "klee";
version = "3.1-unstable-2025-07-11";
src = fetchFromGitHub {
owner = "klee";
repo = "klee";
rev = "1c9fbc1013a6000b39615cc9a5aba83e43a4bf75";
hash = "sha256-D93T0mBBrIhQTS42ScUHPrMoqCI55Y6Yp7snLmlriQM=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
llvmPackages.llvm
cryptominisat
gperftools
sqlite
stp
z3
];
nativeCheckInputs = [
gtest
# Should appear BEFORE lit, since lit passes through python rather
# than the python environment we make.
kleePython
(lit.override { python = kleePython; })
];
cmakeBuildType =
if debug then
"Debug"
else if !debug && includeDebugInfo then
"RelWithDebInfo"
else
"MinSizeRel";
cmakeFlags =
let
onOff = val: if val then "ON" else "OFF";
in
[
"-DKLEE_RUNTIME_BUILD_TYPE=${if debugRuntime then "Debug" else "Release"}"
"-DLLVMCC=${llvmPackages.clang}/bin/clang"
"-DLLVMCXX=${llvmPackages.clang}/bin/clang++"
"-DKLEE_ENABLE_TIMESTAMP=${onOff false}"
"-DKLEE_UCLIBC_PATH=${chosenKleeuClibc}"
"-DENABLE_KLEE_ASSERTS=${onOff asserts}"
"-DENABLE_POSIX_RUNTIME=${onOff true}"
"-DENABLE_UNIT_TESTS=${onOff true}"
"-DENABLE_SYSTEM_TESTS=${onOff true}"
"-DLIT_ARGS=--verbose"
"-DGTEST_SRC_DIR=${gtest.src}"
"-DGTEST_INCLUDE_DIR=${gtest.src}/googletest/include"
"-Wno-dev"
];
# Silence various warnings during the compilation of fortified bitcode.
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-macro-redefined" ];
env.FILECHECK_OPTS = "--dump-input-filter=all";
env.LIT_XFAIL = lib.concatStringsSep ";" [
"KLEE :: ArrayOpt/test_expr_arbitrary.c"
"KLEE :: CXX/SimpleVirtual.cpp"
"KLEE :: CXX/StaticConstructor.cpp"
"KLEE :: CXX/StaticDestructor.cpp"
"KLEE :: Concrete/ConstantExpr.ll"
"KLEE :: Concrete/OverlappingPhiNodes.ll"
"KLEE :: Concrete/UnorderedPhiNodes.ll"
"KLEE :: DeterministicAllocation/nullpage-read.c"
"KLEE :: DeterministicAllocation/nullpage-write.c"
"KLEE :: DeterministicAllocation/use-after-free-loh.c"
"KLEE :: DeterministicAllocation/use-after-free.c"
"KLEE :: Dogfood/ImmutableSet.cpp"
"KLEE :: Feature/Atomic.c"
"KLEE :: Feature/DivCheck.c"
"KLEE :: Feature/ExtCall.c"
"KLEE :: Feature/ExtCallWarnings.c"
"KLEE :: Feature/FunctionAlias.c"
"KLEE :: Feature/FunctionAliasExit.c"
"KLEE :: Feature/LargeArrayBecomesSym.c"
"KLEE :: Feature/LowerSwitch.c"
"KLEE :: Feature/MakeSymbolicName.c"
"KLEE :: Feature/NoExternalCallsAllowed.c"
"KLEE :: Feature/Optimize.c"
"KLEE :: Feature/OvershiftCheck.c"
"KLEE :: Feature/ReadStringAtAddress.c"
"KLEE :: Feature/SeedConcretizeExternalCall.c"
"KLEE :: Feature/ShiftCheck.c"
"KLEE :: Feature/consecutive_divide_by_zero.c"
"KLEE :: Feature/srem.c"
"KLEE :: InlineAsm/RaiseAsm.c"
"KLEE :: InlineAsm/asm_lifting.ll"
"KLEE :: Intrinsics/IntrinsicTrap.ll"
"KLEE :: Intrinsics/IsConstant.ll"
"KLEE :: Intrinsics/Missing.ll"
"KLEE :: Intrinsics/Overflow.ll"
"KLEE :: Intrinsics/OverflowMul.ll"
"KLEE :: Intrinsics/Saturating.ll"
"KLEE :: Intrinsics/noalias-scope-decl.ll"
"KLEE :: Intrinsics/objectsize.ll"
"KLEE :: Replay/klee-replay/KleeZesti.c"
"KLEE :: Replay/libkleeruntest/replay_posix_runtime.c"
"KLEE :: Runtime/FreeStanding/memcpy_chk_err.c"
"KLEE :: Runtime/POSIX/CanonicalizeFileName.c"
"KLEE :: Runtime/POSIX/DirConsistency.c"
"KLEE :: Runtime/POSIX/DirSeek.c"
"KLEE :: Runtime/POSIX/Envp.c"
"KLEE :: Runtime/POSIX/FDNumbers.c"
"KLEE :: Runtime/POSIX/FD_Fail.c"
"KLEE :: Runtime/POSIX/FD_Fail2.c"
"KLEE :: Runtime/POSIX/Fcntl.c"
"KLEE :: Runtime/POSIX/FilePerm.c"
"KLEE :: Runtime/POSIX/FreeArgv.c"
"KLEE :: Runtime/POSIX/Futimesat.c"
"KLEE :: Runtime/POSIX/Getenv.c"
"KLEE :: Runtime/POSIX/Ioctl.c"
"KLEE :: Runtime/POSIX/Isatty.c"
"KLEE :: Runtime/POSIX/MixedConcreteSymbolic.c"
"KLEE :: Runtime/POSIX/Openat.c"
"KLEE :: Runtime/POSIX/PrgName.c"
"KLEE :: Runtime/POSIX/Read1.c"
"KLEE :: Runtime/POSIX/Replay.c"
"KLEE :: Runtime/POSIX/SeedAndFail.c"
"KLEE :: Runtime/POSIX/Stdin.c"
"KLEE :: Runtime/POSIX/SymFileConsistency.c"
"KLEE :: Runtime/POSIX/TestMain.c"
"KLEE :: Runtime/POSIX/Usage.c"
"KLEE :: Runtime/POSIX/Write1.c"
"KLEE :: Runtime/POSIX/Write2.c"
"KLEE :: Runtime/POSIX/_exit.c"
"KLEE :: Runtime/Uclibc/2007-10-08-optimization-calls-wrong-libc-functions.c"
"KLEE :: Runtime/klee-libc/mempcpy.c"
"KLEE :: Solver/Z3ConstantArray.c"
"KLEE :: UBSan/ubsan_alignment-type-mismatch.c"
"KLEE :: UBSan/ubsan_array_bounds.c"
"KLEE :: UBSan/ubsan_pointer_overflow-pointer_arithmetic.c"
"KLEE :: UBSan/ubsan_signed_integer_overflow.c"
"KLEE :: UBSan/ubsan_unsigned_integer_overflow.c"
"KLEE :: UBSan/ubsan_unsigned_shift_base.c"
"KLEE :: UBSan/ubsan_vla_bound.c"
"KLEE :: VarArgs/FunctionAliasVarArg.c"
"KLEE :: VarArgs/VarArg.c"
"KLEE :: VarArgs/VarArgAlignment.c"
"KLEE :: VarArgs/VarArgByVal.c"
"KLEE :: VarArgs/VarArgByValReported.c"
"KLEE :: VarArgs/VarArgLongDouble.c"
"KLEE :: VectorInstructions/floating_point_ops_constant.c"
"KLEE :: VectorInstructions/integer_ops_constant.c"
"KLEE :: VectorInstructions/integer_ops_signed_symbolic.c"
"KLEE :: VectorInstructions/integer_ops_unsigned_symbolic.c"
"KLEE :: VectorInstructions/memset.c"
"KLEE :: VectorInstructions/oob-write.c"
"KLEE :: VectorInstructions/shuffle_element.c"
"KLEE :: klee-stats/KleeStatsTermClasses.c"
"KLEE :: regression/2008-03-11-free-of-malloc-zero.c"
"KLEE :: regression/2014-07-04-unflushed-error-report.c"
"KLEE :: regression/2016-11-24-bitcast-weak-alias.c"
];
prePatch = ''
patchShebangs --build .
'';
# https://github.com/klee/klee/issues/1690
hardeningDisable = [ "fortify" ];
enableParallelBuilding = true;
doCheck = true;
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(\\d\\.\\d)"
];
};
# Let the user access the chosen uClibc outside the derivation.
uclibc = chosenKleeuClibc;
};
__structuredAttrs = true;
meta = with lib; {
mainProgram = "klee";
description = "Symbolic virtual machine built on top of LLVM";
longDescription = ''
KLEE is a symbolic virtual machine built on top of the LLVM compiler
infrastructure. Currently, there are two primary components:
1. The core symbolic virtual machine engine; this is responsible for
executing LLVM bitcode modules with support for symbolic values. This
is comprised of the code in lib/.
2. A POSIX/Linux emulation layer oriented towards supporting uClibc, with
additional support for making parts of the operating system environment
symbolic.
Additionally, there is a simple library for replaying computed inputs on
native code (for closed programs). There is also a more complicated
infrastructure for replaying the inputs generated for the POSIX/Linux
emulation layer, which handles running native programs in an environment
that matches a computed test input, including setting up files, pipes,
environment variables, and passing command line arguments.
'';
homepage = "https://klee.github.io";
license = licenses.ncsa;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ numinit ];
# Upstream is still working on support for LLVM ≥ 16; see:
#
# * <https://github.com/klee/klee/pull/1664>
# * <https://github.com/klee/klee/pull/1745>
# * <https://github.com/klee/klee/pull/1751>
# * <https://github.com/klee/klee/issues/1754>
#
# The package builds with LLVM 18 but 23% of the tests unexpectedly
# fail due to missing functionality for newer LLVM versions. We
# mark them as expected failures above to allow the package to
# build for those who want to experiment with KLEE, but mark it
# broken to avoid giving the impression that this is the expected
# user experience and level of support.
broken = true;
};
}

View File

@@ -0,0 +1,116 @@
{
lib,
llvmPackages,
fetchurl,
fetchFromGitHub,
linuxHeaders,
python3,
curl,
which,
nix-update-script,
debugRuntime ? true,
runtimeAsserts ? false,
extraKleeuClibcConfig ? { },
}:
let
localeSrcBase = "uClibc-locale-030818.tgz";
localeSrc = fetchurl {
url = "http://www.uclibc.org/downloads/${localeSrcBase}";
sha256 = "xDYr4xijjxjZjcz0YtItlbq5LwVUi7k/ZSmP6a+uvVc=";
};
resolvedExtraKleeuClibcConfig = lib.mapAttrsToList (name: value: "${name}=${value}") (
extraKleeuClibcConfig
// {
"UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" = "n";
"RUNTIME_PREFIX" = "/";
"DEVEL_PREFIX" = "/";
}
);
in
llvmPackages.stdenv.mkDerivation rec {
pname = "klee-uclibc";
version = "1.4";
src = fetchFromGitHub {
owner = "klee";
repo = "klee-uclibc";
rev = "klee_uclibc_v${version}";
hash = "sha256-sogQK5Ed0k5tf4rrYwCKT4YRKyEovgT25p0BhGvJ1ok=";
};
nativeBuildInputs = [
llvmPackages.clang
llvmPackages.llvm
python3
curl
which
];
# Some uClibc sources depend on Linux headers.
UCLIBC_KERNEL_HEADERS = "${linuxHeaders}/include";
# HACK: needed for cross-compile.
# See https://www.mail-archive.com/klee-dev@imperial.ac.uk/msg03141.html
KLEE_CFLAGS = "-idirafter ${llvmPackages.clang}/resource-root/include";
prePatch = ''
patchShebangs --build ./configure
patchShebangs --build ./extra
'';
# klee-uclibc configure does not support --prefix, so we override configurePhase entirely
configurePhase = ''
./configure ${
lib.escapeShellArgs (
[ "--make-llvm-lib" ]
++ lib.optional (!debugRuntime) "--enable-release"
++ lib.optional runtimeAsserts "--enable-assertions"
)
}
# Set all the configs we care about.
configs=(
PREFIX=$out
)
for value in ${lib.escapeShellArgs resolvedExtraKleeuClibcConfig}; do
configs+=("$value")
done
for configFile in .config .config.cmd; do
for config in "''${configs[@]}"; do
prefix="''${config%%=*}="
if grep -q "$prefix" "$configFile"; then
sed -i "s"'\001'"''${prefix}"'\001'"#''${prefix}"'\001'"g" "$configFile"
fi
echo "$config" >> "$configFile"
done
done
'';
# Link the locale source into the correct place
preBuild = ''
ln -sf ${localeSrc} extra/locale/${localeSrcBase}
'';
makeFlags = [ "HAVE_DOT_CONFIG=y" ];
enableParallelBuilding = true;
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(\\d\\.\\d)"
];
};
meta = with lib; {
description = "Modified version of uClibc for KLEE";
longDescription = ''
klee-uclibc is a bitcode build of uClibc meant for compatibility with the
KLEE symbolic virtual machine.
'';
homepage = "https://github.com/klee/klee-uclibc";
license = licenses.lgpl3;
maintainers = with maintainers; [ numinit ];
};
}

View File

@@ -0,0 +1,72 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
makeWrapper,
eprover,
ocaml,
camlp4,
perl,
zlib,
}:
stdenv.mkDerivation rec {
pname = "leo2";
version = "1.7.0";
src = fetchurl {
url = "https://page.mi.fu-berlin.de/cbenzmueller/leo/leo2_v${version}.tgz";
sha256 = "sha256:1b2q7vsz6s9ighypsigqjm1mzjiq3xgnz5id5ssb4rh9zm190r82";
};
strictDeps = true;
nativeBuildInputs = [
makeWrapper
eprover
ocaml
camlp4
perl
];
buildInputs = [ zlib ];
patches = [
(fetchpatch {
url = "https://github.com/niklasso/minisat/commit/7eb6015313561a2586032574788fcb133eeaa19f.patch";
stripLen = 1;
extraPrefix = "lib/";
sha256 = "sha256:01ln7hi6nvvkqkhn9hciqizizz5qspvqffgksvgmzn9x7kdd9pnh";
})
];
preConfigure = ''
cd src
patchShebangs configure
substituteInPlace Makefile.pre \
--replace '+camlp4' "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
'';
buildFlags = [ "opt" ];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-reserved-user-defined-literal";
preInstall = "mkdir -p $out/bin";
postInstall = ''
mkdir -p "$out/etc"
echo -e "e = ${eprover}/bin/eprover\\nepclextract = ${eprover}/bin/epclextract" > "$out/etc/leoatprc"
wrapProgram $out/bin/leo \
--add-flags "--atprc $out/etc/leoatprc"
'';
meta = with lib; {
description = "High-performance typed higher order prover";
mainProgram = "leo";
maintainers = [ maintainers.raskin ];
platforms = platforms.unix;
license = licenses.bsd3;
homepage = "http://www.leoprover.org/";
};
}

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
ncurses,
ocamlPackages,
}:
stdenv.mkDerivation rec {
pname = "prooftree";
version = "0.14";
src = fetchurl {
url = "https://askra.de/software/prooftree/releases/prooftree-${version}.tar.gz";
sha256 = "sha256-nekV2UnjibOk4h0jZ1jV7W5pE/hXWb3fUoLTJb3Jzc0=";
};
strictDeps = true;
nativeBuildInputs = [
pkg-config
]
++ (with ocamlPackages; [
ocaml
findlib
camlp5
]);
buildInputs = [ ncurses ] ++ (with ocamlPackages; [ lablgtk ]);
prefixKey = "--prefix ";
meta = with lib; {
description = "Program for proof-tree visualization";
mainProgram = "prooftree";
longDescription = ''
Prooftree is a program for proof-tree visualization during interactive
proof development in a theorem prover. It is currently being developed
for Coq and Proof General. Prooftree helps against getting lost between
different subgoals in interactive proof development. It clearly shows
where the current subgoal comes from and thus helps in developing the
right plan for solving it.
Prooftree uses different colors for the already proven subgoals, the
current branch in the proof and the still open subgoals. Sequent texts
are not displayed in the proof tree itself, but they are shown as a
tool-tip when the mouse rests over a sequent symbol. Long proof commands
are abbreviated in the tree display, but show up in full length as
tool-tip. Both, sequents and proof commands, can be shown in the display
below the tree (on single click) or in a separate window (on double or
shift-click).
'';
homepage = "http://askra.de/software/prooftree";
platforms = platforms.unix;
maintainers = [ maintainers.jwiegley ];
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,186 @@
# - The csdp program used for the Micromega tactic is statically referenced.
# However, rocq can build without csdp by setting it to null.
# In this case some Micromega tactics will search the user's path for the csdp program and will fail if it is not found.
# - The exact version can be specified through the `version` argument to
# the derivation; it defaults to the latest stable version.
{
lib,
stdenv,
fetchzip,
fetchurl,
writeText,
pkg-config,
customOCamlPackages ? null,
ocamlPackages_4_14,
ncurses,
csdp ? null,
version,
rocq-version ? null,
}@args:
let
lib = import ../../../../build-support/rocq/extra-lib.nix { inherit (args) lib; };
release = {
"9.0.0".sha256 = "sha256-GRwYSvrJGiPD+I82gLOgotb+8Ra5xHZUJGcNwxWqZkU=";
"9.1.0".sha256 = "sha256-+QL7I1/0BfT87n7lSaOmpHj2jJuDB4idWhAxwzvVQOE=";
};
releaseRev = v: "V${v}";
fetched =
import ../../../../build-support/coq/meta-fetch/default.nix
{
inherit
lib
stdenv
fetchzip
fetchurl
;
}
{
inherit release releaseRev;
location = {
owner = "coq";
repo = "coq";
};
}
args.version;
version = fetched.version;
rocq-version =
args.rocq-version or (if version != "dev" then lib.versions.majorMinor version else "dev");
csdpPatch = lib.optionalString (csdp != null) ''
substituteInPlace plugins/micromega/sos.ml --replace-warn "; csdp" "; ${csdp}/bin/csdp"
substituteInPlace plugins/micromega/coq_micromega.ml --replace-warn "System.is_in_system_path \"csdp\"" "true"
'';
ocamlPackages = if customOCamlPackages != null then customOCamlPackages else ocamlPackages_4_14;
ocamlNativeBuildInputs = [
ocamlPackages.ocaml
ocamlPackages.findlib
ocamlPackages.dune_3
];
ocamlPropagatedBuildInputs = [ ocamlPackages.zarith ];
self = stdenv.mkDerivation {
pname = "rocq";
inherit (fetched) version src;
passthru = {
inherit rocq-version;
inherit ocamlPackages ocamlNativeBuildInputs;
inherit ocamlPropagatedBuildInputs;
emacsBufferSetup = pkgs: ''
; Propagate rocq paths to children
(inherit-local-permanent coq-prog-name "${self}/bin/rocq repl")
(inherit-local-permanent coq-dependency-analyzer "${self}/bin/rocq dep")
(inherit-local-permanent coq-compiler "${self}/bin/rocq c")
; If the coq-library path was already set, re-set it based on our current rocq
(when (fboundp 'get-coq-library-directory)
(inherit-local-permanent coq-library-directory (get-coq-library-directory))
(coq-prog-args))
(mapc (lambda (arg)
(when (file-directory-p (concat arg "/lib/coq/${rocq-version}/user-contrib"))
(setenv "ROCQPATH" (concat (getenv "ROCQPATH") ":" arg "/lib/coq/${rocq-version}/user-contrib")))) '(${
lib.concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)
}))
; TODO Abstract this pattern from here and nixBufferBuilders.withPackages!
(defvar nixpkgs--rocq-buffer-count 0)
(when (eq nixpkgs--rocq-buffer-count 0)
(make-variable-buffer-local 'nixpkgs--is-nixpkgs-rocq-buffer)
(defun nixpkgs--rocq-inherit (buf)
(inherit-local-inherit-child buf)
(with-current-buffer buf
(setq nixpkgs--rocq-buffer-count (1+ nixpkgs--rocq-buffer-count))
(add-hook 'kill-buffer-hook 'nixpkgs--decrement-rocq-buffer-count nil t))
buf)
; When generating a scomint buffer, do inherit-local inheritance and make it a nixpkgs-rocq buffer
(defun nixpkgs--around-scomint-make (orig &rest r)
(if nixpkgs--is-nixpkgs-rocq-buffer
(progn
(advice-add 'get-buffer-create :filter-return #'nixpkgs--rocq-inherit)
(apply orig r)
(advice-remove 'get-buffer-create #'nixpkgs--rocq-inherit))
(apply orig r)))
(advice-add 'scomint-make :around #'nixpkgs--around-scomint-make)
; When we have no more rocq buffers, tear down the buffer handling
(defun nixpkgs--decrement-rocq-buffer-count ()
(setq nixpkgs--rocq-buffer-count (1- nixpkgs--rocq-buffer-count))
(when (eq nixpkgs--rocq-buffer-count 0)
(advice-remove 'scomint-make #'nixpkgs--around-scomint-make)
(fmakunbound 'nixpkgs--around-scomint-make)
(fmakunbound 'nixpkgs--rocq-inherit)
(fmakunbound 'nixpkgs--decrement-rocq-buffer-count))))
(setq nixpkgs--rocq-buffer-count (1+ nixpkgs--rocq-buffer-count))
(add-hook 'kill-buffer-hook 'nixpkgs--decrement-rocq-buffer-count nil t)
(setq nixpkgs--is-nixpkgs-rocq-buffer t)
(inherit-local 'nixpkgs--is-nixpkgs-rocq-buffer)
'';
};
nativeBuildInputs = [ pkg-config ] ++ ocamlNativeBuildInputs;
buildInputs = [ ncurses ];
propagatedBuildInputs = ocamlPropagatedBuildInputs;
postPatch = ''
UNAME=$(type -tp uname)
RM=$(type -tp rm)
substituteInPlace tools/beautify-archive --replace-warn "/bin/rm" "$RM"
${csdpPatch}
'';
setupHook = writeText "setupHook.sh" ''
addRocqPath () {
if test -d "''$1/lib/coq/${rocq-version}/user-contrib"; then
export ROCQPATH="''${ROCQPATH-}''${ROCQPATH:+:}''$1/lib/coq/${rocq-version}/user-contrib/"
fi
}
addEnvHooks "$targetOffset" addRocqPath
'';
preConfigure = ''
patchShebangs dev/tools/
'';
prefixKey = "-prefix ";
enableParallelBuilding = true;
createFindlibDestdir = true;
buildPhase = ''
runHook preBuild
make dunestrap
dune build -p rocq-runtime,rocq-core -j $NIX_BUILD_CORES
runHook postBuild
'';
installPhase = ''
runHook preInstall
dune install --prefix $out rocq-runtime rocq-core
ln -s $out/lib/rocq-runtime $OCAMLFIND_DESTDIR/rocq-runtime
ln -s $out/lib/rocq-core $OCAMLFIND_DESTDIR/rocq-core
runHook postInstall
'';
meta = with lib; {
description = "Rocq Prover";
longDescription = ''
The Rocq Prover is an interactive theorem prover, or proof assistant. It provides
a formal language to write mathematical definitions, executable
algorithms and theorems together with an environment for
semi-interactive development of machine-checked proofs.
'';
homepage = "https://rocq-prover.org";
license = licenses.lgpl21;
branch = rocq-version;
maintainers = with maintainers; [
proux01
roconnor
vbgl
Zimmi48
];
platforms = platforms.unix;
mainProgram = "rocq";
};
};
in
self

View File

@@ -0,0 +1,111 @@
{
lib,
stdenv,
fetchurl,
ocaml,
zlib,
which,
eprover,
makeWrapper,
coq,
}:
stdenv.mkDerivation rec {
pname = "satallax";
version = "2.7";
strictDeps = true;
nativeBuildInputs = [
makeWrapper
ocaml
which
eprover
coq
];
buildInputs = [ zlib ];
src = fetchurl {
url = "https://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${pname}-${version}.tar.gz";
sha256 = "1kvxn8mc35igk4vigi5cp7w3wpxk2z3bgwllfm4n3h2jfs0vkpib";
};
patches = [
# GCC9 doesn't allow default value in friend declaration.
./fix-declaration-gcc9.patch
];
prePatch = ''
patch -p1 -i ${./minisat-fenv.patch} -d minisat
'';
preConfigure = ''
mkdir fake-tools
echo "echo 'Nix-build-host.localdomain'" > fake-tools/hostname
chmod a+x fake-tools/hostname
export PATH="$PATH:$PWD/fake-tools"
(
cd picosat-*
./configure
make
)
export PATH="$PATH:$PWD/libexec/satallax"
mkdir -p "$out/libexec/satallax"
cp picosat-*/picosat picosat-*/picomus "$out/libexec/satallax"
(
cd minisat
export MROOT=$PWD
cd core
make
cd ../simp
make
)
'';
# error: invalid suffix on literal; C++11 requires a space between literal and identifier
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-reserved-user-defined-literal";
installPhase = ''
mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax"
cp bin/satallax.opt "$out/bin/satallax"
wrapProgram "$out/bin/satallax" \
--suffix PATH : "${
lib.makeBinPath [
coq
eprover
]
}:$out/libexec/satallax" \
--add-flags "-M" --add-flags "$out/lib/satallax/modes"
cp LICENSE README "$out/share/doc/satallax"
cp bin/*.so "$out/lib"
cp -r modes "$out/lib/satallax/"
cp -r problems "$out/lib/satallax/"
cp -r coq* "$out/lib/satallax/"
'';
doCheck = stdenv.hostPlatform.isLinux;
checkPhase = ''
runHook preCheck
if bash ./test | grep ERROR; then
echo "Tests failed"
exit 1
fi
runHook postCheck
'';
meta = {
description = "Automated theorem prover for higher-order logic";
mainProgram = "satallax";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.raskin ];
platforms = lib.platforms.unix;
downloadPage = "http://www.ps.uni-saarland.de/~cebrown/satallax/downloads.php";
homepage = "http://www.ps.uni-saarland.de/~cebrown/satallax/index.php";
};
}

View File

@@ -0,0 +1,21 @@
diff --git i/minisat/core/SolverTypes.h w/minisat/core/SolverTypes.h
--- i/minisat/core/SolverTypes.h
+++ w/minisat/core/SolverTypes.h
@@ -47,7 +47,7 @@ struct Lit {
int x;
// Use this as a constructor:
- friend Lit mkLit(Var var, bool sign = false);
+ friend Lit mkLit(Var var, bool sign);
bool operator == (Lit p) const { return x == p.x; }
bool operator != (Lit p) const { return x != p.x; }
@@ -55,7 +55,7 @@ struct Lit {
};
-inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
+inline Lit mkLit (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; }
inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; }
inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
inline bool sign (Lit p) { return p.x & 1; }

View File

@@ -0,0 +1,57 @@
diff --git a/core/Main.cc b/core/Main.cc
index 2b0d97b..9ba985d 100644
--- a/core/Main.cc
+++ b/core/Main.cc
@@ -77,9 +77,13 @@ int main(int argc, char** argv)
setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n");
// printf("This is MiniSat 2.0 beta\n");
-#if defined(__linux__)
- fpu_control_t oldcw, newcw;
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+#if defined(__linux__) && defined(__x86_64__)
+ fenv_t fenv;
+
+ fegetenv(&fenv);
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+ fesetenv(&fenv);
printf("WARNING: for repeatability, setting FPU to use double precision\n");
#endif
// Extra options:
diff --git a/simp/Main.cc b/simp/Main.cc
index 2804d7f..7fbdb33 100644
--- a/simp/Main.cc
+++ b/simp/Main.cc
@@ -78,9 +78,13 @@ int main(int argc, char** argv)
setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n where input may be either in plain or gzipped DIMACS.\n");
// printf("This is MiniSat 2.0 beta\n");
-#if defined(__linux__)
- fpu_control_t oldcw, newcw;
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
+#if defined(__linux__) && defined(__x86_64__)
+ fenv_t fenv;
+
+ fegetenv(&fenv);
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
+ fesetenv(&fenv);
printf("WARNING: for repeatability, setting FPU to use double precision\n");
#endif
// Extra options:
diff --git a/utils/System.h b/utils/System.h
index 1758192..840bee5 100644
--- a/utils/System.h
+++ b/utils/System.h
@@ -21,8 +21,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
#ifndef Minisat_System_h
#define Minisat_System_h
-#if defined(__linux__)
-#include <fpu_control.h>
+#if defined(__linux__) && defined(__x86_64__)
+#include <fenv.h>
#endif
#include "mtl/IntTypes.h"

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchurl,
ocaml,
}:
stdenv.mkDerivation rec {
pname = "statverif";
version = "1.86pl4";
src = fetchurl {
url = "http://prosecco.gforge.inria.fr/personal/bblanche/proverif/proverif${version}.tar.gz";
sha256 = "163vdcixs764jj8xa08w80qm4kcijf7xj911yp8jvz6pi1q5g13i";
};
pf-patch = fetchurl {
url = "http://markryan.eu/research/statverif/files/proverif-${version}-statverif-2657ab4.patch";
sha256 = "113jjhi1qkcggbsmbw8fa9ln8vs7vy2r288szks7rn0jjn0wxmbw";
};
strictDeps = true;
nativeBuildInputs = [ ocaml ];
patchPhase = "patch -p1 < ${pf-patch}";
buildPhase = "./build";
installPhase = ''
mkdir -p $out/bin
cp ./proverif $out/bin/statverif
cp ./proveriftotex $out/bin/statveriftotex
'';
meta = {
description = "Verification of stateful processes (via Proverif)";
homepage = "https://markryan.eu/research/statverif/";
license = lib.licenses.gpl2;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.thoughtpolice ];
};
}

View File

@@ -0,0 +1,213 @@
{
haskellPackages,
fetchFromGitHub,
lib,
stdenv,
# the following are non-haskell dependencies
makeWrapper,
which,
maude,
graphviz,
glibcLocales,
}:
let
inherit (haskellPackages) mkDerivation;
version = "1.10.0";
src = fetchFromGitHub {
owner = "tamarin-prover";
repo = "tamarin-prover";
rev = version;
hash = "sha256-v1BruU2p/Sg/g7b9a+QRza46bD7PkMtsGq82qFaNhpI=";
};
# tamarin has its own dependencies, but they're kept inside the repo,
# no submodules. this factors out the common metadata among all derivations
common = pname: src: {
inherit pname version src;
license = lib.licenses.gpl3;
homepage = "https://tamarin-prover.github.io";
description = "Security protocol verification in the symbolic model";
maintainers = [ lib.maintainers.thoughtpolice ];
hydraPlatforms = lib.platforms.linux; # maude is broken on darwin
};
# tamarin use symlinks to the LICENSE and Setup.hs files, so for these sublibraries
# we set the patchPhase to fix that. otherwise, cabal cries a lot.
replaceSymlinks = ''
cp --remove-destination ${src}/LICENSE .;
cp --remove-destination ${src}/Setup.hs .;
'';
tamarin-prover-utils = mkDerivation (
common "tamarin-prover-utils" (src + "/lib/utils")
// {
postPatch = replaceSymlinks;
libraryHaskellDepends = with haskellPackages; [
base64-bytestring
blaze-builder
list-t
dlist
exceptions
fclabels
haskellPackages.graphviz
safe
SHA
split
syb
];
}
);
tamarin-prover-term = mkDerivation (
common "tamarin-prover-term" (src + "/lib/term")
// {
postPatch = replaceSymlinks;
libraryHaskellDepends =
(with haskellPackages; [
attoparsec
HUnit
])
++ [ tamarin-prover-utils ];
}
);
tamarin-prover-theory = mkDerivation (
common "tamarin-prover-theory" (src + "/lib/theory")
// {
postPatch = replaceSymlinks;
doHaddock = false; # broken
libraryHaskellDepends =
(with haskellPackages; [
aeson
aeson-pretty
parallel
uniplate
regex-pcre-builtin
regex-posix
split
])
++ [
tamarin-prover-utils
tamarin-prover-term
];
}
);
tamarin-prover-sapic = mkDerivation (
common "tamarin-prover-sapic" (src + "/lib/sapic")
// {
postPatch = "cp --remove-destination ${src}/LICENSE .";
doHaddock = false; # broken
libraryHaskellDepends =
(with haskellPackages; [
raw-strings-qq
])
++ [ tamarin-prover-theory ];
}
);
tamarin-prover-accountability = mkDerivation (
common "tamarin-prover-accountability" (src + "/lib/accountability")
// {
postPatch = "cp --remove-destination ${src}/LICENSE .";
doHaddock = false; # broken
libraryHaskellDepends =
(with haskellPackages; [
raw-strings-qq
])
++ [
tamarin-prover-utils
tamarin-prover-term
tamarin-prover-theory
];
}
);
tamarin-prover-export = mkDerivation (
common "tamarin-prover-export" (src + "/lib/export")
// {
postPatch = "cp --remove-destination ${src}/LICENSE .";
doHaddock = false; # broken
libraryHaskellDepends = [
tamarin-prover-utils
tamarin-prover-term
tamarin-prover-theory
tamarin-prover-sapic
];
}
);
in
mkDerivation (
common "tamarin-prover" src
// {
isLibrary = false;
isExecutable = true;
# strip out unneeded deps manually
doHaddock = false;
enableSharedExecutables = false;
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
# wrap the prover to be sure it can find maude, sapic, etc
executableToolDepends = [
makeWrapper
which
maude
graphviz
];
postInstall = ''
wrapProgram $out/bin/tamarin-prover \
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
--set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
''
+ ''
--prefix PATH : ${
lib.makeBinPath [
which
maude
graphviz
]
}
# so that the package can be used as a vim plugin to install syntax coloration
install -Dt $out/share/vim-plugins/tamarin-prover/syntax/ etc/syntax/spthy.vim
install etc/filetype.vim -D $out/share/vim-plugins/tamarin-prover/ftdetect/tamarin.vim
mkdir -p $out/share/nvim
ln -s $out/share/vim-plugins/tamarin-prover $out/share/nvim/site
# Emacs SPTHY major mode
install -Dt $out/share/emacs/site-lisp etc/spthy-mode.el
'';
checkPhase = "./dist/build/tamarin-prover/tamarin-prover test";
executableHaskellDepends =
(with haskellPackages; [
binary-instances
binary-orphans
blaze-html
conduit
file-embed
gitrev
http-types
resourcet
shakespeare
threads
wai
warp
yesod-core
yesod-static
])
++ [
tamarin-prover-utils
tamarin-prover-sapic
tamarin-prover-accountability
tamarin-prover-export
tamarin-prover-term
tamarin-prover-theory
];
}
)

View File

@@ -0,0 +1,68 @@
{
fetchurl,
lib,
stdenv,
ocaml,
isabelle,
cvc3,
perl,
wget,
which,
}:
stdenv.mkDerivation rec {
pname = "tlaps";
version = "1.4.5";
src = fetchurl {
url = "https://tla.msr-inria.inria.fr/tlaps/dist/${version}/tlaps-${version}.tar.gz";
sha256 = "c296998acd14d5b93a8d5be7ee178007ef179957465966576bda26944b1b7fca";
};
strictDeps = true;
nativeBuildInputs = [
ocaml
isabelle
cvc3
perl
wget
which
];
installPhase = ''
mkdir -pv "$out"
export HOME="$out"
export PATH=$out/bin:$PATH
pushd zenon
./configure --prefix $out
make
make install
popd
pushd isabelle
isabelle build -b Pure
popd
pushd tlapm
./configure --prefix $out
make all
make install
'';
meta = {
description = "Mechanically check TLA+ proofs";
longDescription = ''
TLA+ is a general-purpose formal specification language that is
particularly useful for describing concurrent and distributed
systems. The TLA+ proof language is declarative, hierarchical,
and scalable to large system specifications. It provides a
consistent abstraction over the various backend verifiers.
'';
homepage = "https://tla.msr-inria.inria.fr/tlaps/content/Home.html";
license = lib.licenses.bsd2;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ florentc ];
};
}

View File

@@ -0,0 +1,117 @@
{
callPackage,
fetchurl,
lib,
stdenv,
ocamlPackages,
coqPackages,
rubber,
hevea,
emacs,
version ? "1.8.2",
ideSupport ? true,
wrapGAppsHook3,
}:
stdenv.mkDerivation rec {
pname = "why3";
inherit version;
src = fetchurl {
url = "https://why3.gitlabpages.inria.fr/releases/${pname}-${version}.tar.gz";
hash =
{
"1.8.2" = "sha256-t9ES7dW8zmvM4AI9K8g06yrhocQteupE/6Ek1km1C+o=";
"1.7.2" = "sha256-VaSG/FiO2MDdSSFXGJJrIylQx0LPwtT8AF7TpPVZhCQ=";
"1.6.0" = "sha256-hFvM6kHScaCtcHCc6Vezl9CR7BFbiKPoTEh7kj0ZJxw=";
}
."${version}";
};
strictDeps = true;
nativeBuildInputs =
lib.optional ideSupport wrapGAppsHook3
++ (with ocamlPackages; [
ocaml
findlib
menhir
])
++ [
# Coq Support
coqPackages.coq
];
buildInputs =
with ocamlPackages;
[
ocamlgraph
zarith
# Emacs compilation of why3.el
emacs
# Documentation
rubber
hevea
]
++
lib.optional ideSupport
# GUI
lablgtk3-sourceview3
++ [
# WebIDE
js_of_ocaml
js_of_ocaml-ppx
# S-expression output for why3pp
ppx_deriving
ppx_sexp_conv
]
++
# Coq Support
(with coqPackages; [
coq
flocq
]);
propagatedBuildInputs = with ocamlPackages; [
camlzip
menhirLib
(if lib.versionAtLeast version "1.8.0" then zarith else num)
re
sexplib
];
enableParallelBuilding = true;
configureFlags = [
"--enable-verbose-make"
(lib.enableFeature ideSupport "ide")
];
outputs = [
"out"
"dev"
];
installTargets = [
"install"
"install-lib"
];
postInstall = ''
mkdir -p $dev/lib
mv $out/lib/ocaml $dev/lib/
'';
passthru.withProvers = callPackage ./with-provers.nix { };
meta = with lib; {
description = "Platform for deductive program verification";
homepage = "https://why3.lri.fr/";
license = licenses.lgpl21;
platforms = platforms.unix;
maintainers = with maintainers; [
thoughtpolice
vbgl
];
};
}

View File

@@ -0,0 +1,38 @@
{
stdenv,
makeWrapper,
runCommand,
why3,
}:
provers:
let
configAwkScript = runCommand "why3-conf.awk" { inherit provers; } ''
for p in $provers; do
for b in $p/bin/*; do
BASENAME=$(basename $b)
echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out
done
done
echo '{ print }' >> $out
'';
in
stdenv.mkDerivation {
pname = "${why3.pname}-with-provers";
version = why3.version;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ why3 ] ++ provers;
dontUnpack = true;
buildPhase = ''
mkdir -p $out/share/why3/
why3 config detect -C $out/share/why3/why3.conf
awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf
'';
installPhase = ''
mkdir -p $out/bin
makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--config $out/share/why3/why3.conf"
'';
}

View File

@@ -0,0 +1,31 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation {
pname = "OpenBUGS";
version = "3.2.3";
outputs = [ "out" ];
src = fetchFromGitHub {
owner = "jsta";
repo = "openbugs";
rev = "cd921342ba13ee89ee60f9aebd2e96c42bd59ae3";
sha256 = "sha256-11LrScN1kvtq0Fo7RWGjbQO0U5b5brCbipl5pdZnrFs=";
};
meta = with lib; {
description = "Software package for performing Bayesian analysis and simulation using Markov Chain Monte Carlo";
homepage = "https://github.com/jsta/openbugs/";
changelog = "https://github.com/jsta/openbugs/blob/master/ChangeLog";
platforms = [
"i686-linux"
"x86_64-linux"
];
license = licenses.gpl3Only;
maintainers = with maintainers; [ andresnav ];
};
}

View File

@@ -0,0 +1,243 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
fetchurl,
# build
cmake,
ctags,
python3Packages,
swig,
# math
eigen,
blas,
lapack,
glpk,
# data
protobuf,
json_c,
libxml2,
hdf5,
curl,
# compression
libarchive,
bzip2,
xz,
snappy,
lzo,
# more math
nlopt,
lp_solve,
colpack,
# extra support
pythonSupport ? false,
opencvSupport ? false,
opencv ? null,
withSvmLight ? false,
}:
assert pythonSupport -> python3Packages != null;
assert opencvSupport -> opencv != null;
assert (!blas.isILP64) && (!lapack.isILP64);
let
pname = "shogun";
version = "6.1.4";
rxcppVersion = "4.0.0";
gtestVersion = "1.8.0";
srcs = {
toolbox = fetchFromGitHub {
owner = "shogun-toolbox";
repo = "shogun";
rev = "shogun_${version}";
hash = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
fetchSubmodules = true;
};
# The CMake external projects expect the packed archives
rxcpp = fetchurl {
url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
sha256 = "sha256-UOc5WrG8KgAA3xJsaSCjbdPE7gSnFJay9MEK31DWUXg=";
};
gtest = fetchurl {
url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
sha256 = "sha256-WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=";
};
};
in
stdenv.mkDerivation (finalAttrs: {
inherit pname version;
outputs = [
"out"
"dev"
"doc"
];
src = srcs.toolbox;
patches = [
# Fix compile errors with GCC 9+
# https://github.com/shogun-toolbox/shogun/pull/4811
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/c8b670be4790e0f06804b048a6f3d77c17c3ee95.patch";
sha256 = "sha256-MxsR3Y2noFQevfqWK3nmX5iK4OVWeKBl5tfeDNgjcXk=";
})
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/5aceefd9fb0e2132c354b9a0c0ceb9160cc9b2f7.patch";
sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw=";
})
# Fix virtual destruction
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/ef0e4dc1cc4a33c9e6b17a108fa38a436de2d7ee.patch";
sha256 = "sha256-a9Rm0ytqkSAgC3dguv8m3SwOSipb+VByBHHdmV0d63w=";
})
./fix-virtual-destruction.patch
# Fix compile errors with json-c
# https://github.com/shogun-toolbox/shogun/pull/4104
(fetchpatch {
url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
sha256 = "sha256-OhEWwrHtD/sOcjHmPY/C9zJ8ruww8yXrRcTw38nGEJU=";
})
# Fix compile errors with Eigen 3.4
./eigen-3.4.patch
]
++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch;
nativeBuildInputs = [
cmake
swig
ctags
]
++ (with python3Packages; [
python
jinja2
ply
]);
buildInputs = [
eigen
blas
lapack
glpk
protobuf
json_c
libxml2
hdf5
curl
libarchive
bzip2
xz
snappy
lzo
nlopt
lp_solve
colpack
]
++ lib.optionals pythonSupport (
with python3Packages;
[
python
numpy
]
)
++ lib.optional opencvSupport opencv;
cmakeFlags =
let
excludeTestsRegex = lib.concatStringsSep "|" [
# segfault
"SerializationXML"
"TrainedModelSerialization"
# broken by openblas 0.3.21
"mathematics_lapack"
# fails on aarch64
"LinearTimeMMD"
"QuadraticTimeMMD"
"SGVectorTest"
"Statistics"
# hangs on aarch64
"PRange"
# these take too long on CI
"evaluation_cross_validation"
"modelselection_combined_kernel"
"modelselection_grid_search"
];
in
[
(lib.cmakeBool "BUILD_META_EXAMPLES" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_ARPACK" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_ARPREC" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_CPLEX" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_Mosek" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_TFLogger" true)
(lib.cmakeBool "CMAKE_DISABLE_FIND_PACKAGE_ViennaCL" true)
(lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'${excludeTestsRegex}'")
(lib.cmakeBool "ENABLE_TESTING" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "DISABLE_META_INTEGRATION_TESTS" true)
(lib.cmakeBool "TRAVIS_DISABLE_META_CPP" true)
(lib.cmakeBool "INTERFACE_PYTHON" pythonSupport)
(lib.cmakeBool "OpenCV" opencvSupport)
(lib.cmakeBool "USE_SVMLIGHT" withSvmLight)
];
CXXFLAGS = "-faligned-new";
doCheck = true;
postUnpack = ''
mkdir -p $sourceRoot/third_party/{rxcpp,GoogleMock}
ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz
ln -s ${srcs.gtest} $sourceRoot/third_party/GoogleMock/release-${gtestVersion}.tar.gz
'';
postPatch = ''
# Fix preprocessing SVMlight code
sed -i \
-e 's@#ifdef SVMLIGHT@#ifdef USE_SVMLIGHT@' \
-e '/^#ifdef USE_SVMLIGHT/,/^#endif/ s@#endif@#endif //USE_SVMLIGHT@' \
src/shogun/kernel/string/CommUlongStringKernel.cpp
sed -i -e 's/#if USE_SVMLIGHT/#ifdef USE_SVMLIGHT/' src/interfaces/swig/Machine.i
sed -i -e 's@// USE_SVMLIGHT@//USE_SVMLIGHT@' src/interfaces/swig/Transfer.i
sed -i -e 's@/\* USE_SVMLIGHT \*/@//USE_SVMLIGHT@' src/interfaces/swig/Transfer_includes.i
''
+ lib.optionalString (!withSvmLight) ''
# Run SVMlight scrubber
patchShebangs scripts/light-scrubber.sh
echo "removing SVMlight code"
./scripts/light-scrubber.sh
'';
postInstall = ''
mkdir -p $doc/share/doc/shogun/examples
mv $out/share/shogun/examples/cpp $doc/share/doc/shogun/examples
cp ../examples/undocumented/libshogun/*.cpp $doc/share/doc/shogun/examples/cpp
rm -r $out/share
'';
postFixup = ''
# CMake incorrectly calculates library path from dev prefix
substituteInPlace $dev/lib/cmake/shogun/ShogunTargets-release.cmake \
--replace-fail "\''${_IMPORT_PREFIX}/lib/" "$out/lib/"
'';
meta = with lib; {
description = "Toolbox which offers a wide range of efficient and unified machine learning methods";
homepage = "http://shogun-toolbox.org/";
license = if withSvmLight then licenses.unfree else licenses.gpl3Plus;
maintainers = with maintainers; [
edwtjo
smancill
];
};
})

View File

@@ -0,0 +1,74 @@
From: Sebastián Mancilla <smancill@smancill.dev>
Subject: [PATCH] Fix compile errors when using Eigen 3.4
---
.../machine/gp/MultiLaplaceInferenceMethod.cpp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
index 2e27678d2..60050afea 100644
--- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
+++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
@@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base
float64_t result=0;
for(index_t bl=0; bl<C; bl++)
{
- eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0);
- result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0;
- eigen_f.block(bl*n,0,n,1)+=eigen_m;
+ eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0);
+ result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0;
+ eigen_f.segment(bl*n,n)+=eigen_m;
}
// get first and second derivatives of log likelihood
@@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
{
Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen);
for(index_t bl=0; bl<C; bl++)
- eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1);
+ eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n);
//alpha'*(f-m)/2.0
Psi_New=alpha.dot(eigen_mu)/2.0;
@@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
for(index_t bl=0; bl<C; bl++)
{
- VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt();
+ VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt();
LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+
MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols));
MatrixXd eigen_L_tmp=chol_tmp.matrixU();
@@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha()
VectorXd tmp2=m_tmp.array().rowwise().sum();
for(index_t bl=0; bl<C; bl++)
- eigen_b.block(bl*n,0,n,1)+=eigen_dpi.block(bl*n,0,n,1).cwiseProduct(eigen_mu.block(bl*n,0,n,1)-eigen_mean_bl-tmp2);
+ eigen_b.segment(bl*n,n)+=eigen_dpi.segment(bl*n,n).cwiseProduct(eigen_mu.segment(bl*n,n)-eigen_mean_bl-tmp2);
Map<VectorXd> &eigen_c=eigen_W;
for(index_t bl=0; bl<C; bl++)
- eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1));
+ eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n));
Map<MatrixXd> c_tmp(eigen_c.data(),n,C);
@@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t
{
result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array()
*eigen_dK.array()).sum();
- result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1));
+ result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n));
}
return result/2.0;
@@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean(
result[i]=0;
//currently only compute the explicit term
for(index_t bl=0; bl<C; bl++)
- result[i]-=eigen_alpha.block(bl*n,0,n,1).dot(eigen_dmu);
+ result[i]-=eigen_alpha.segment(bl*n,n).dot(eigen_dmu);
}
return result;

View File

@@ -0,0 +1,20 @@
From: Sebastián Mancilla <smancill@smancill.dev>
Subject: Fix virtual destruction
---
src/shogun/solver/LDASolver.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shogun/solver/LDASolver.h b/src/shogun/solver/LDASolver.h
index 9300a85c5..d500eca5d 100644
--- a/src/shogun/solver/LDASolver.h
+++ b/src/shogun/solver/LDASolver.h
@@ -87,7 +87,7 @@ namespace shogun
compute_within_cov();
}
- ~LDASolver()
+ virtual ~LDASolver()
{
SG_UNREF(m_features)
SG_UNREF(m_labels)

View File

@@ -0,0 +1,76 @@
From: Sebastián Mancilla <smancill@smancill.dev>
Subject: Update SVMlight scrubber script
This requires previously fixing a few wrong preprocessor directives that
are supposed to fence code using SVMlight.
- The script was too eager and removing *.light files in SVMlight format
that are used by other tests. The code reading those files doesn't use
any SVMlight code so it should be fine to keep it and run the tests.
- The Python test *domainadaptationsvm.py was not removed because of
wrong globbing.
- Remove a couple of examples using SVMlight that were missed.
- The script is actually modifying (and breaking) itself because the
grep for the USE_SVMLIGHT macro is too eager again and matches itself
(and the version stored in upstream's Debian package control tarball
is broken because of it). Just fix it by grepping for preprocessor
directives only.
- No need to fix the Transfer_includes.i file in the script with a final
%} when its preprocessor directives have been fixed.
- The Swig files were moved to a new directory at some point but the
script was not updated accordingly.
---
scripts/light-scrubber.sh | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff a/scripts/light-scrubber.sh b/scripts/light-scrubber.sh
--- a/scripts/light-scrubber.sh
+++ b/scripts/light-scrubber.sh
@@ -26,14 +26,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-rm -rf examples/*/*/{*light*,*_domainadaptationsvm_*} \
+rm -rf examples/*/*/{*light*.*,*domainadaptationsvm*} \
examples/undocumented/matlab_and_octave/tests/*light* \
+ examples/undocumented/python/serialization_string_kernels.py \
+ examples/undocumented/python/mkl_binclass.py \
src/shogun/classifier/svm/SVMLight.* \
src/shogun/classifier/svm/SVMLightOneClass.* \
src/shogun/regression/svr/SVRLight.* \
doc/md/LICENSE_SVMlight*
-for _file in `grep -rl USE_SVMLIGHT .`
+grep -rl '^#ifdef USE_SVMLIGHT' . | while read -r _file
do
sed -i.orig -e \
'/\#ifdef USE_SVMLIGHT/,/\#endif \/\/USE_SVMLIGHT/c \\' ${_file} && \
@@ -41,7 +43,7 @@ do
rm -rf ${_file}.orig
done
-for _file in `find . -depth -name 'CMakeLists.txt'`
+find . -depth -name 'CMakeLists.txt' | while read -r _file
do
sed -i.orig -e 's!.*_sv[mr]light_.*!!g' ${_file} && \
touch -r ${_file}.orig ${_file} && \
@@ -56,13 +58,7 @@ do
rm -rf ${_file}.orig
done
-_file="src/interfaces/modular/Transfer_includes.i" && \
-cp -a ${_file} ${_file}.orig && \
-echo '%}' >> ${_file} && \
-touch -r ${_file}.orig ${_file} && \
-rm -rf ${_file}.orig
-
-_file="src/interfaces/modular/Machine.i" && \
+_file="src/interfaces/swig/Machine.i" && \
sed -i.orig -e '/.*CSVRLight.*/d' ${_file} && \
touch -r ${_file}.orig ${_file} && \
rm -rf ${_file}.orig

View File

@@ -0,0 +1,248 @@
{
lib,
stdenv,
fetchurl,
bzip2,
gfortran,
libX11,
libXmu,
libXt,
libjpeg,
libpng,
libtiff,
ncurses,
pango,
pcre2,
perl,
readline,
tcl,
texlive,
texliveSmall,
tk,
xz,
zlib,
less,
texinfo,
graphviz,
icu,
pkg-config,
bison,
which,
jdk,
blas,
lapack,
curl,
tzdata,
withRecommendedPackages ? true,
enableStrictBarrier ? false,
enableMemoryProfiling ? false,
# R as of writing does not support outputting both .so and .a files; it outputs:
# --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
static ? false,
testers,
}:
assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation (finalAttrs: {
pname = "R";
version = "4.5.1";
src =
let
inherit (finalAttrs) pname version;
in
fetchurl {
url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
hash = "sha256-tCp5IUADhmRbEBBbkcaHKHh9tcTIPJ9sMKzc5jLhu3A=";
};
outputs = [
"out"
"tex"
];
nativeBuildInputs = [
bison
perl
pkg-config
tzdata
which
];
buildInputs = [
bzip2
gfortran
libX11
libXmu
libXt
libXt
libjpeg
libpng
libtiff
ncurses
pango
pcre2
readline
(texliveSmall.withPackages (
ps: with ps; [
inconsolata
helvetic
ps.texinfo
fancyvrb
cm-super
rsfs
]
))
xz
zlib
less
texinfo
graphviz
icu
which
blas
lapack
curl
tcl
tk
jdk
];
strictDeps = true;
patches = [
./no-usr-local-search-paths.patch
];
# Test of the examples for package 'tcltk' fails in Darwin sandbox. See:
# https://github.com/NixOS/nixpkgs/issues/146131
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure \
--replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
--replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
--replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
substituteInPlace tests/Examples/Makefile.in \
--replace "test-Examples: test-Examples-Base" "test-Examples:" # do not test the examples
'';
dontDisableStatic = static;
preConfigure = ''
configureFlagsArray=(
--disable-lto
--with${lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
--with-blas="-L${blas}/lib -lblas"
--with-lapack="-L${lapack}/lib -llapack"
--with-readline
--with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
--with-cairo
--with-libpng
--with-jpeglib
--with-libtiff
--with-ICU
${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"}
${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
AR=$(type -p ar)
AWK=$(type -p gawk)
CC=$(type -p cc)
CXX=$(type -p c++)
FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
JAVA_HOME="${jdk}"
RANLIB=$(type -p ranlib)
CURL_CONFIG="${lib.getExe' (lib.getDev curl) "curl-config"}"
r_cv_have_curl728=yes
R_SHELL="${stdenv.shell}"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
--disable-R-framework
--without-x
OBJC="clang"
CPPFLAGS="-isystem ${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"
LDFLAGS="-L${lib.getLib stdenv.cc.libcxx}/lib"
''
+ ''
)
echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib"
echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo"
'';
installTargets = [
"install"
"install-info"
"install-pdf"
];
# move tex files to $tex for use with texlive.combine
# add link in $out since ${R_SHARE_DIR}/texmf is hardcoded in several places
postInstall = ''
mv -T "$out/lib/R/share/texmf" "$tex"
ln -s "$tex" "$out/lib/R/share/texmf"
'';
# The store path to "which" is baked into src/library/base/R/unix/system.unix.R,
# but Nix cannot detect it as a run-time dependency because the installed file
# is compiled and compressed, which hides the store path.
postFixup = ''
echo ${which} > $out/nix-support/undetected-runtime-dependencies
${lib.optionalString stdenv.hostPlatform.isLinux ''find $out -name "*.so" -exec patchelf {} --add-rpath $out/lib/R/lib \;''}
'';
doCheck = true;
preCheck = "export HOME=$TMPDIR; export TZ=CET; bin/Rscript -e 'sessionInfo()'";
enableParallelBuilding = true;
setupHook = ./setup-hook.sh;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
# make tex output available to texlive.combine
passthru.pkgs = [ finalAttrs.finalPackage.tex ];
passthru.tlType = "run";
# dependencies (based on \RequirePackage in jss.cls, Rd.sty, Sweave.sty)
passthru.tlDeps = with texlive; [
amsfonts
amsmath
fancyvrb
graphics
hyperref
iftex
jknapltx
latex
lm
tools
upquote
url
];
meta = with lib; {
homepage = "http://www.r-project.org/";
description = "Free software environment for statistical computing and graphics";
license = licenses.gpl2Plus;
longDescription = ''
GNU R is a language and environment for statistical computing and
graphics that provides a wide variety of statistical (linear and
nonlinear modelling, classical statistical tests, time-series
analysis, classification, clustering, ...) and graphical
techniques, and is highly extensible. One of R's strengths is the
ease with which well-designed publication-quality plots can be
produced, including mathematical symbols and formulae where
needed. R is an integrated suite of software facilities for data
manipulation, calculation and graphical display. It includes an
effective data handling and storage facility, a suite of operators
for calculations on arrays, in particular matrices, a large,
coherent, integrated collection of intermediate tools for data
analysis, graphical facilities for data analysis and display
either on-screen or on hardcopy, and a well-developed, simple and
effective programming language which includes conditionals, loops,
user-defined recursive functions and input and output facilities.
'';
pkgConfigModules = [ "libR" ];
platforms = platforms.all;
maintainers = with maintainers; [ jbedo ];
teams = [ teams.sage ];
};
})

View File

@@ -0,0 +1,24 @@
diff -ubr R-3.0.1-orig/configure R-3.0.1/configure
--- R-3.0.1-orig/configure 2013-07-04 10:46:42.336133947 +0200
+++ R-3.0.1/configure 2013-07-04 10:46:17.181919960 +0200
@@ -3800,13 +3800,13 @@
: ${LIBnn=$libnn}
## We provide these defaults so that headers and libraries in
## '/usr/local' are found (by the native tools, mostly).
-if test -f "/sw/etc/fink.conf"; then
- : ${CPPFLAGS="-I/sw/include -I/usr/local/include"}
- : ${LDFLAGS="-L/sw/lib -L/usr/local/lib"}
-else
- : ${CPPFLAGS="-I/usr/local/include"}
- : ${LDFLAGS="-L/usr/local/${LIBnn}"}
-fi
+# if test -f "/sw/etc/fink.conf"; then
+# : ${CPPFLAGS="-I/sw/include -I/usr/local/include"}
+# : ${LDFLAGS="-L/sw/lib -L/usr/local/lib"}
+# else
+# : ${CPPFLAGS="-I/usr/local/include"}
+# : ${LDFLAGS="-L/usr/local/${LIBnn}"}
+# fi
## take care not to override the command-line setting
if test "${libdir}" = '${exec_prefix}/lib'; then

View File

@@ -0,0 +1,7 @@
addRLibPath () {
if [[ -d "$1/library" ]]; then
addToSearchPath R_LIBS_SITE "$1/library"
fi
}
addEnvHooks "$targetOffset" addRLibPath

View File

@@ -0,0 +1,47 @@
diff --git a/Makefile b/Makefile
index c823f66e..65b90c5e 100644
--- a/Makefile
+++ b/Makefile
@@ -32,9 +32,9 @@ SRC_DIRS := $(shell find * -type d -exec bash -c "find {} -maxdepth 1 \
LIBRARY_NAME := $(PROJECT)
LIB_BUILD_DIR := $(BUILD_DIR)/lib
STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
-DYNAMIC_VERSION_MAJOR := 1
-DYNAMIC_VERSION_MINOR := 0
-DYNAMIC_VERSION_REVISION := 0
+DYNAMIC_VERSION_MAJOR := 1
+DYNAMIC_VERSION_MINOR := 0
+DYNAMIC_VERSION_REVISION := 0
DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
#DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index c48255c8..cf4c580e 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -105,7 +105,6 @@ if(USE_OPENCV)
endif()
# ---[ BLAS
-if(NOT APPLE)
set(BLAS "Atlas" CACHE STRING "Selected BLAS library")
set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL")
@@ -123,17 +122,6 @@ if(NOT APPLE)
list(APPEND Caffe_LINKER_LIBS PUBLIC ${MKL_LIBRARIES})
list(APPEND Caffe_DEFINITIONS PUBLIC -DUSE_MKL)
endif()
-elseif(APPLE)
- find_package(vecLib REQUIRED)
- list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${vecLib_INCLUDE_DIR})
- list(APPEND Caffe_LINKER_LIBS PUBLIC ${vecLib_LINKER_LIBS})
-
- if(VECLIB_FOUND)
- if(NOT vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
- list(APPEND Caffe_DEFINITIONS PUBLIC -DUSE_ACCELERATE)
- endif()
- endif()
-endif()
# ---[ Python
if(BUILD_python)

View File

@@ -0,0 +1,182 @@
{
stdenv,
lib,
fetchFromGitHub,
fetchurl,
fetchpatch,
cmake,
boost,
gflags,
glog,
hdf5-cpp,
opencv4,
protobuf,
doxygen,
blas,
lmdbSupport ? true,
lmdb,
leveldbSupport ? true,
leveldb,
snappy,
pythonSupport ? false,
python ? null,
numpy ? null,
replaceVars,
}:
let
toggle = bool: if bool then "ON" else "OFF";
test_model_weights = fetchurl {
url = "http://dl.caffe.berkeleyvision.org/bvlc_reference_caffenet.caffemodel";
sha256 = "472d4a06035497b180636d8a82667129960371375bd10fcb6df5c6c7631f25e0";
};
in
stdenv.mkDerivation rec {
pname = "caffe";
version = "1.0";
src = fetchFromGitHub {
owner = "BVLC";
repo = "caffe";
rev = version;
sha256 = "104jp3cm823i3cdph7hgsnj6l77ygbwsy35mdmzhmsi4jxprd9j3";
};
nativeBuildInputs = [
cmake
doxygen
];
cmakeFlags =
# It's important that caffe is passed the major and minor version only because that's what
# boost_python expects
[
(if pythonSupport then "-Dpython_version=${python.pythonVersion}" else "-DBUILD_python=OFF")
"-DBLAS=open"
"-DCPU_ONLY=ON"
]
++ [ "-DUSE_LEVELDB=${toggle leveldbSupport}" ]
++ [ "-DUSE_LMDB=${toggle lmdbSupport}" ];
buildInputs = [
boost
gflags
glog
protobuf
hdf5-cpp
opencv4
blas
]
++ lib.optional lmdbSupport lmdb
++ lib.optionals leveldbSupport [
leveldb
snappy
]
++ lib.optionals pythonSupport [
python
numpy
];
propagatedBuildInputs = lib.optionals pythonSupport (
# requirements.txt
let
pp = python.pkgs;
in
(
[
pp.numpy
pp.scipy
pp.scikit-image
pp.h5py
pp.matplotlib
pp.ipython
pp.networkx
pp.pandas
pp.python-dateutil
pp.protobuf
pp.gflags
pp.pyyaml
pp.pillow
pp.six
]
++ lib.optional leveldbSupport pp.leveldb
)
);
outputs = [
"bin"
"out"
];
propagatedBuildOutputs = [ ]; # otherwise propagates out -> bin cycle
patches = [
./darwin.patch
./glog-cmake.patch
./random-shuffle.patch
(fetchpatch {
name = "support-opencv4";
url = "https://github.com/BVLC/caffe/pull/6638/commits/0a04cc2ccd37ba36843c18fea2d5cbae6e7dd2b5.patch";
hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI=";
})
]
++ lib.optional pythonSupport (
replaceVars ./python.patch {
inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy
}
);
postPatch = ''
substituteInPlace src/caffe/util/io.cpp --replace \
'SetTotalBytesLimit(kProtoReadBytesLimit, 536870912)' \
'SetTotalBytesLimit(kProtoReadBytesLimit)'
'';
preConfigure = lib.optionalString pythonSupport ''
# We need this when building with Python bindings
export BOOST_LIBRARYDIR="${boost.out}/lib";
'';
postInstall = ''
# Internal static library.
rm $out/lib/libproto.a
# Install models
cp -a ../models $out/share/Caffe/models
moveToOutput "bin" "$bin"
''
+ lib.optionalString pythonSupport ''
mkdir -p $out/${python.sitePackages}
mv $out/python/caffe $out/${python.sitePackages}
rm -rf $out/python
'';
doInstallCheck = false; # build takes more than 30 min otherwise
installCheckPhase = ''
model=bvlc_reference_caffenet
m_path="$out/share/Caffe/models/$model"
$bin/bin/caffe test \
-model "$m_path/deploy.prototxt" \
-solver "$m_path/solver.prototxt" \
-weights "${test_model_weights}"
'';
meta = with lib; {
description = "Deep learning framework";
longDescription = ''
Caffe is a deep learning framework made with expression, speed, and
modularity in mind. It is developed by the Berkeley Vision and Learning
Center (BVLC) and by community contributors.
'';
homepage = "http://caffe.berkeleyvision.org/";
maintainers = [ ];
broken =
(pythonSupport && (python.isPy310))
|| !(leveldbSupport -> (leveldb != null && snappy != null))
|| !(pythonSupport -> (python != null && numpy != null));
license = licenses.bsd2;
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,97 @@
From 38b81bb53304d7a3f6aed36f7b4e77b6efa78338 Mon Sep 17 00:00:00 2001
From: uku <hi@uku.moe>
Date: Wed, 14 May 2025 16:55:15 +0200
Subject: [PATCH] fix linking against glog 0.7.x
---
cmake/Dependencies.cmake | 2 +-
cmake/External/glog.cmake | 4 +--
cmake/Modules/FindGlog.cmake | 48 ------------------------------------
3 files changed, 3 insertions(+), 51 deletions(-)
delete mode 100644 cmake/Modules/FindGlog.cmake
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 4a5bac47..88aa123f 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -32,7 +32,7 @@ endif()
# ---[ Google-glog
include("cmake/External/glog.cmake")
list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${GLOG_INCLUDE_DIRS})
-list(APPEND Caffe_LINKER_LIBS PUBLIC ${GLOG_LIBRARIES})
+list(APPEND Caffe_LINKER_LIBS PUBLIC glog::glog)
# ---[ Google-gflags
include("cmake/External/gflags.cmake")
diff --git a/cmake/External/glog.cmake b/cmake/External/glog.cmake
index f9d0549c..43414544 100644
--- a/cmake/External/glog.cmake
+++ b/cmake/External/glog.cmake
@@ -5,8 +5,8 @@ if (NOT __GLOG_INCLUDED)
set(__GLOG_INCLUDED TRUE)
# try the system-wide glog first
- find_package(Glog)
- if (GLOG_FOUND)
+ find_package(glog REQUIRED)
+ if (glog_FOUND)
set(GLOG_EXTERNAL FALSE)
else()
# fetch and build glog from github
diff --git a/cmake/Modules/FindGlog.cmake b/cmake/Modules/FindGlog.cmake
deleted file mode 100644
index 99abbe47..00000000
--- a/cmake/Modules/FindGlog.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-# - Try to find Glog
-#
-# The following variables are optionally searched for defaults
-# GLOG_ROOT_DIR: Base directory where all GLOG components are found
-#
-# The following are set after configuration is done:
-# GLOG_FOUND
-# GLOG_INCLUDE_DIRS
-# GLOG_LIBRARIES
-# GLOG_LIBRARYRARY_DIRS
-
-include(FindPackageHandleStandardArgs)
-
-set(GLOG_ROOT_DIR "" CACHE PATH "Folder contains Google glog")
-
-if(WIN32)
- find_path(GLOG_INCLUDE_DIR glog/logging.h
- PATHS ${GLOG_ROOT_DIR}/src/windows)
-else()
- find_path(GLOG_INCLUDE_DIR glog/logging.h
- PATHS ${GLOG_ROOT_DIR})
-endif()
-
-if(MSVC)
- find_library(GLOG_LIBRARY_RELEASE libglog_static
- PATHS ${GLOG_ROOT_DIR}
- PATH_SUFFIXES Release)
-
- find_library(GLOG_LIBRARY_DEBUG libglog_static
- PATHS ${GLOG_ROOT_DIR}
- PATH_SUFFIXES Debug)
-
- set(GLOG_LIBRARY optimized ${GLOG_LIBRARY_RELEASE} debug ${GLOG_LIBRARY_DEBUG})
-else()
- find_library(GLOG_LIBRARY glog
- PATHS ${GLOG_ROOT_DIR}
- PATH_SUFFIXES lib lib64)
-endif()
-
-find_package_handle_standard_args(Glog DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARY)
-
-if(GLOG_FOUND)
- set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
- set(GLOG_LIBRARIES ${GLOG_LIBRARY})
- message(STATUS "Found glog (include: ${GLOG_INCLUDE_DIR}, library: ${GLOG_LIBRARY})")
- mark_as_advanced(GLOG_ROOT_DIR GLOG_LIBRARY_RELEASE GLOG_LIBRARY_DEBUG
- GLOG_LIBRARY GLOG_INCLUDE_DIR)
-endif()
--
2.49.0

View File

@@ -0,0 +1,70 @@
commit b14ca23651d390fcae4a929dedc7c33a83453a66
Author: Frederik Rietdijk <fridh@fridh.nl>
Date: Sun Feb 17 08:41:27 2019 +0100
Find boost_pythonXX
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08f56a33..0a04592a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,10 +99,10 @@ add_subdirectory(docs)
add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)
# ---[ pytest target
-if(BUILD_python)
- add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
- add_dependencies(pytest pycaffe)
-endif()
+# if(BUILD_python)
+# add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
+# add_dependencies(pytest pycaffe)
+# endif()
# ---[ uninstall target
configure_file(
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 4a5bac47..be026d43 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -141,37 +141,14 @@ if(BUILD_python)
# use python3
find_package(PythonInterp 3.0)
find_package(PythonLibs 3.0)
- find_package(NumPy 1.7.1)
- # Find the matching boost python implementation
- set(version ${PYTHONLIBS_VERSION_STRING})
-
- STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} )
- find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}")
- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
-
- while(NOT "${version}" STREQUAL "" AND NOT Boost_PYTHON_FOUND)
- STRING( REGEX REPLACE "([0-9.]+).[0-9]+" "\\1" version ${version} )
-
- STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} )
- find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}")
- set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
-
- STRING( REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version ${version} )
- if("${has_more_version}" STREQUAL "")
- break()
- endif()
- endwhile()
- if(NOT Boost_PYTHON_FOUND)
- find_package(Boost 1.46 COMPONENTS python)
- endif()
else()
# disable Python 3 search
find_package(PythonInterp 2.7)
find_package(PythonLibs 2.7)
- find_package(NumPy 1.7.1)
- find_package(Boost 1.46 COMPONENTS python)
endif()
- if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON_FOUND)
+ find_package(NumPy 1.7.1)
+ find_package(Boost 1.46 REQUIRED COMPONENTS python@major@@minor@)
+ if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON@major@@minor@_FOUND)
set(HAVE_PYTHON TRUE)
if(BUILD_python_layer)
list(APPEND Caffe_DEFINITIONS PRIVATE -DWITH_PYTHON_LAYER)

View File

@@ -0,0 +1,67 @@
From 11e585e52ab92bb9d7a995c5002cb55fbff687b2 Mon Sep 17 00:00:00 2001
From: uku <hi@uku.moe>
Date: Thu, 15 May 2025 11:10:50 +0200
Subject: [PATCH] fix: remove usages of random_shuffle
---
src/caffe/layers/hdf5_data_layer.cpp | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/caffe/layers/hdf5_data_layer.cpp b/src/caffe/layers/hdf5_data_layer.cpp
index 00716a92..01213691 100644
--- a/src/caffe/layers/hdf5_data_layer.cpp
+++ b/src/caffe/layers/hdf5_data_layer.cpp
@@ -61,7 +61,9 @@ void HDF5DataLayer<Dtype>::LoadHDF5FileData(const char* filename) {
// Shuffle if needed.
if (this->layer_param_.hdf5_data_param().shuffle()) {
- std::random_shuffle(data_permutation_.begin(), data_permutation_.end());
+ std::random_device rand_device;
+ std::default_random_engine rand_engine(rand_device());
+ std::shuffle(data_permutation_.begin(), data_permutation_.end(), rand_engine);
DLOG(INFO) << "Successfully loaded " << hdf_blobs_[0]->shape(0)
<< " rows (shuffled)";
} else {
@@ -104,7 +106,9 @@ void HDF5DataLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
// Shuffle if needed.
if (this->layer_param_.hdf5_data_param().shuffle()) {
- std::random_shuffle(file_permutation_.begin(), file_permutation_.end());
+ std::random_device rand_device;
+ std::default_random_engine rand_engine(rand_device());
+ std::shuffle(file_permutation_.begin(), file_permutation_.end(), rand_engine);
}
// Load the first HDF5 file and initialize the line counter.
@@ -137,14 +141,17 @@ bool HDF5DataLayer<Dtype>::Skip() {
template<typename Dtype>
void HDF5DataLayer<Dtype>::Next() {
+ std::random_device rand_device;
+ std::default_random_engine rand_engine(rand_device());
if (++current_row_ == hdf_blobs_[0]->shape(0)) {
if (num_files_ > 1) {
++current_file_;
if (current_file_ == num_files_) {
current_file_ = 0;
if (this->layer_param_.hdf5_data_param().shuffle()) {
- std::random_shuffle(file_permutation_.begin(),
- file_permutation_.end());
+ std::shuffle(file_permutation_.begin(),
+ file_permutation_.end(),
+ rand_engine);
}
DLOG(INFO) << "Looping around to first file.";
}
@@ -153,7 +160,7 @@ void HDF5DataLayer<Dtype>::Next() {
}
current_row_ = 0;
if (this->layer_param_.hdf5_data_param().shuffle())
- std::random_shuffle(data_permutation_.begin(), data_permutation_.end());
+ std::shuffle(data_permutation_.begin(), data_permutation_.end(), rand_engine);
}
offset_++;
}
--
2.49.0

View File

@@ -0,0 +1,51 @@
{
stdenv,
lib,
fetchFromGitHub,
cmake,
pkg-config,
qt6,
libarchive,
libpng,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "CEmu";
version = "2.0";
src = fetchFromGitHub {
owner = "CE-Programming";
repo = "CEmu";
rev = "v${finalAttrs.version}";
hash = "sha256-fohsIJrvPDMmYHoPbmYQlKLMnj/B3XEBaerZYuqxvd8=";
fetchSubmodules = true;
};
sourceRoot = "${finalAttrs.src.name}/gui/qt/";
patches = [
# This is resolved upstream, but I can't apply the patch because the
# sourceRoot isn't set to the base of the Git repo.
./resolve-ambiguous-constexpr.patch
];
nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
pkg-config
];
buildInputs = [
qt6.qtbase
libarchive
libpng
];
meta = with lib; {
description = "Third-party TI-84 Plus CE / TI-83 Premium CE emulator, focused on developer features";
mainProgram = "CEmu";
homepage = "https://ce-programming.github.io/CEmu";
license = licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,13 @@
diff --git a/mainwindow.cpp b/mainwindow.cpp
index f03a743e..70c29a45 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -970,7 +970,7 @@ void MainWindow::showEvent(QShowEvent *e) {
DockWidget *MainWindow::redistributeFindDock(const QPoint &pos) {
QWidget *child = childAt(pos);
if (QTabBar *tabBar = findSelfOrParent<QTabBar *>(child)) {
- child = childAt({pos.x(), tabBar->mapTo(this, QPoint{}).y() - 1});
+ child = childAt(QPoint({pos.x(), tabBar->mapTo(this, QPoint{}).y() - 1}));
}
return findSelfOrParent<DockWidget *>(child);
}

View File

@@ -0,0 +1,183 @@
{
lib,
stdenv,
autoPatchelfHook,
makeDesktopItem,
copyDesktopItems,
makeWrapper,
alsa-lib,
glib,
glib-networking,
gsettings-desktop-schemas,
gtk3,
libsecret,
openjdk,
sqlite,
unixODBC,
gtk2,
xorg,
glibcLocales,
releasePath ? null,
}:
# To use this package, you need to download your own cplex installer from IBM
# and override the releasePath attribute to point to the location of the file.
#
# Note: cplex creates an individual build for each license which screws
# somewhat with the use of functions like requireFile as the hash will be
# different for every user.
stdenv.mkDerivation rec {
pname = "cplex";
version = "22.11";
src =
if releasePath == null then
throw ''
This nix expression requires that the cplex installer is already
downloaded to your machine. Get it from IBM:
https://www.ibm.com/support/pages/downloading-ibm-ilog-cplex-optimization-studio-2211
Set `cplex.releasePath = /path/to/download;` in your
~/.config/nixpkgs/config.nix for `nix-*` commands, or
`config.cplex.releasePath = /path/to/download;` in your
`configuration.nix` for NixOS.
''
else
releasePath;
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
makeWrapper
openjdk
];
buildInputs = [
alsa-lib
gsettings-desktop-schemas
gtk2
sqlite
unixODBC
xorg.libXtst
glibcLocales
];
unpackPhase = "cp $src $name";
postPatch = ''
sed -i -e 's|/usr/bin/tr"|tr" |' $name
'';
buildPhase = ''
runHook preBuild
export JAVA_TOOL_OPTIONS=-Djdk.util.zip.disableZip64ExtraFieldValidation=true
sh $name LAX_VM "$(command -v java)" -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=$out
runHook postBuild
'';
installPhase =
let
libraryPath = lib.makeLibraryPath [
stdenv.cc.cc
glib
gtk2
gtk3
libsecret
xorg.libXtst
];
in
''
runHook preInstall
mkdir -p $out/bin
for pgm in \
$out/opl/bin/x86-64_linux/oplrun \
$out/opl/bin/x86-64_linux/oplrunjava \
$out/opl/oplide/oplide \
$out/cplex/bin/x86-64_linux/cplex \
$out/cpoptimizer/bin/x86-64_linux/cpoptimizer
do
makeWrapperArgs=(
--set-default LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive
)
if [[ "$pgm" = "$out/opl/oplide/oplide" ]]; then
makeWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${libraryPath}
--prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules"
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
)
fi
makeWrapper "$pgm" "$out/bin/$(basename "$pgm")" "''${makeWrapperArgs[@]}"
done
mkdir -p $out/share/pixmaps
ln -s $out/opl/oplide/icon.xpm $out/share/pixmaps/oplide.xpm
mkdir -p $out/share/doc
mv $out/doc $out/share/doc/$name
mkdir -p $out/share/licenses
mv $out/license $out/share/licenses/$name
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "oplide";
desktopName = "IBM ILOG CPLEX Optimization Studio";
genericName = "Optimization Software";
icon = "oplide";
exec = "oplide";
categories = [
"Development"
"IDE"
"Math"
"Science"
];
})
];
fixupPhase = ''
runHook preFixup
rm -r $out/Uninstall
bins=(
$out/bin/*
$out/cplex/bin/x86-64_linux/cplex
$out/cplex/bin/x86-64_linux/cplexamp
$out/cpoptimizer/bin/x86-64_linux/cpoptimizer
$out/opl/bin/x86-64_linux/oplrun
$out/opl/bin/x86-64_linux/oplrunjava
$out/opl/oplide/jre/bin/*
$out/opl/oplide/oplide
)
find $out -type d -exec chmod 755 {} \;
find $out -type f -exec chmod 644 {} \;
chmod +111 "''${bins[@]}"
runHook postFixup
'';
passthru = {
libArch = "x86-64_linux";
libSuffix = "${version}0";
};
meta = with lib; {
description = "Optimization solver for mathematical programming";
homepage = "https://www.ibm.com/be-en/marketplace/ibm-ilog-cplex";
mainProgram = "cplex";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ bfortz ];
};
}

View File

@@ -0,0 +1,76 @@
{
lib,
stdenv,
fetchFromGitHub,
fftw,
libjpeg,
log4cpp,
openjpeg,
libpng12,
poppler,
qtbase,
qt5,
qmake,
wrapQtAppsHook,
}:
stdenv.mkDerivation rec {
pname = "engauge-digitizer";
version = "12.2.2";
src = fetchFromGitHub {
owner = "markummitchell";
repo = "engauge-digitizer";
rev = "v${version}";
sha256 = "sha256-Wj9o3wWbtHsEi6LFH4xDpwVR9BwcWc472jJ/QFDQZvY=";
};
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
buildInputs = [
qtbase
qt5.qttools
poppler
libpng12
openjpeg
openjpeg.dev
log4cpp
libjpeg
fftw
];
qmakeFlags = [
"CONFIG+=jpeg2000"
"CONFIG+=pdf"
"CONFIG+=log4cpp_null"
];
POPPLER_INCLUDE = "${poppler.dev}/include/poppler/qt5";
POPPLER_LIB = "${poppler}/lib";
OPENJPEG_INCLUDE = "${openjpeg.dev}/include/${openjpeg.pname}-${lib.versions.majorMinor openjpeg.version}";
OPENJPEG_LIB = "${openjpeg}/lib";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp bin/engauge $out/bin/
runHook postInstall
'';
meta = with lib; {
description = "Engauge Digitizer is a tool for recovering graph data from an image file";
mainProgram = "engauge";
homepage = "https://markummitchell.github.io/engauge-digitizer";
license = with licenses; [ gpl2Only ];
platforms = platforms.linux;
maintainers = [ maintainers.sheepforce ];
};
}

View File

@@ -0,0 +1,79 @@
{
lib,
stdenv,
fetchurl,
ocamlPackages,
makeWrapper,
libGLU,
libGL,
libglut,
mpfr,
gmp,
pkgsHostTarget,
}:
let
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
in
stdenv.mkDerivation rec {
pname = "glsurf";
version = "3.3.1";
src = fetchurl {
url = "https://raffalli.eu/~christophe/glsurf/glsurf-${version}.tar.gz";
sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
};
nativeBuildInputs = [
makeWrapper
]
++ (with ocamlPackages; [
ocaml
findlib
]);
buildInputs = [
libglut
libGL
libGLU
mpfr
gmp
]
++ (with ocamlPackages; [
camlp4
lablgl
camlimages
num
]);
postPatch = ''
for f in callbacks*/Makefile; do
substituteInPlace "$f" --replace-warn "+camlp4" \
"${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
done
# Fatal error: exception Sys_error("Mutex.unlock: Operation not permitted")
sed -i "/gl_started/d" src/draw.ml* src/main.ml
# Compatibility with camlimages 5.0.5
substituteInPlace src/Makefile --replace-warn camlimages.all_formats camlimages.core
'';
installPhase = ''
mkdir -p $out/bin $out/share/doc/glsurf
cp ./src/glsurf.opt $out/bin/glsurf
cp ./doc/doc.pdf $out/share/doc/glsurf
cp -r ./examples $out/share/doc/glsurf
wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc"
'';
meta = {
homepage = "https://raffalli.eu/~christophe/glsurf/";
description = "Program to draw implicit surfaces and curves";
mainProgram = "glsurf";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,128 @@
{
lib,
stdenv,
fetchpatch,
fetchurl,
cmake,
extra-cmake-modules,
shared-mime-info,
wrapQtAppsHook,
qtbase,
karchive,
kcompletion,
kconfig,
kcoreaddons,
kcrash,
kdoctools,
ki18n,
kiconthemes,
kio,
knewstuff,
kparts,
ktextwidgets,
kxmlgui,
syntax-highlighting,
gsl,
poppler,
fftw,
hdf5,
netcdf,
cfitsio,
libcerf,
# cantor,
zlib,
lz4,
readstat,
matio,
qtserialport,
discount,
}:
stdenv.mkDerivation rec {
pname = "labplot";
version = "2.10.1";
src = fetchurl {
url = "mirror://kde/stable/labplot/labplot-${version}.tar.xz";
sha256 = "sha256-K24YFRfPtuDf/3uJXz6yDHzjWeZzLThUXgdXya6i2u8=";
};
cmakeFlags = [
# Disable Vector BLF since it depends on DBC parser which fails to be detected
"-DENABLE_VECTOR_BLF=OFF"
];
patches = [
(fetchpatch {
name = "matio-fix-compilation-for-latest-version-1.5.27.patch";
url = "https://github.com/KDE/labplot/commit/d6142308ffa492d9f7cea00fad3b4cd1babfd00c.patch";
hash = "sha256-qD5jj6GxBKbQezKJb1Z8HnwFO84WJBGQDawS/6o/wHE=";
})
];
nativeBuildInputs = [
cmake
extra-cmake-modules
shared-mime-info
wrapQtAppsHook
];
buildInputs = [
qtbase
karchive
kcompletion
kconfig
kcoreaddons
kcrash
kdoctools
ki18n
kiconthemes
kio
knewstuff
kparts
ktextwidgets
kxmlgui
syntax-highlighting
gsl
poppler
fftw
hdf5
netcdf
cfitsio
libcerf
# cantor
zlib
lz4
readstat
matio
qtserialport
discount
];
meta = with lib; {
description = "Free, open source and cross-platform data visualization and analysis software accessible to everyone";
homepage = "https://labplot.kde.org";
license = with licenses; [
asl20
bsd3
cc-by-30
cc0
gpl2Only
gpl2Plus
gpl3Only
gpl3Plus
lgpl3Plus
mit
];
maintainers = with maintainers; [ hqurve ];
mainProgram = "labplot2";
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,53 @@
diff --git a/lp_solve/ccc b/lp_solve/ccc
index bd5a938..7fe0427 100644
--- a/lp_solve/ccc
+++ b/lp_solve/ccc
@@ -1,6 +1,6 @@
:
src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-c=cc
+c=$CC
MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
@@ -10,7 +10,7 @@ echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
$c "$MYTMP"/platform.c -o "$MYTMP"/platform
-PLATFORM=`"$MYTMP"/platform`
+PLATFORM=`@emulator@ "$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
mkdir bin bin/$PLATFORM >/dev/null 2>&1
diff --git a/lpsolve55/ccc b/lpsolve55/ccc
index 999f5f6..ff69b17 100644
--- a/lpsolve55/ccc
+++ b/lpsolve55/ccc
@@ -1,6 +1,6 @@
:
src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c'
-c=cc
+c=$CC
MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
@@ -10,7 +10,7 @@ echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
$c "$MYTMP"/platform.c -o "$MYTMP"/platform
-PLATFORM=`"$MYTMP"/platform`
+PLATFORM=`@emulator@ "$MYTMP"/platform`
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
mkdir bin bin/$PLATFORM >/dev/null 2>&1
@@ -42,8 +42,8 @@ fi
opts='-O3'
$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
-ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
-ranlib bin/$PLATFORM/liblpsolve55.a
+$AR rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
+$RANLIB bin/$PLATFORM/liblpsolve55.a
if [ "$so" != "" ]
then

View File

@@ -0,0 +1,83 @@
{
lib,
stdenv,
fetchurl,
cctools,
fixDarwinDylibNames,
autoSignDarwinBinariesHook,
replaceVars,
buildPackages,
binutils,
}:
stdenv.mkDerivation rec {
pname = "lp_solve";
version = "5.5.2.11";
src = fetchurl {
url = "mirror://sourceforge/project/lpsolve/lpsolve/${version}/lp_solve_${version}_source.tar.gz";
sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
};
nativeBuildInputs = [
binutils
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
fixDarwinDylibNames
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
autoSignDarwinBinariesHook
];
env = {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
}
// lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
NIX_LDFLAGS = "-headerpad_max_install_names";
};
dontConfigure = true;
patches = [
(replaceVars ./0001-fix-cross-compilation.patch {
emulator = "${stdenv.hostPlatform.emulator buildPackages}";
})
];
buildPhase =
let
ccc = if stdenv.hostPlatform.isDarwin then "ccc.osx" else "ccc";
in
''
runHook preBuild
(cd lpsolve55 && bash -x -e ${ccc})
(cd lp_solve && bash -x -e ${ccc})
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -d -m755 $out/bin $out/lib $out/include/lpsolve
install -m755 lp_solve/bin/*/lp_solve -t $out/bin
install -m644 lpsolve55/bin/*/liblpsolve* -t $out/lib
install -m644 lp_*.h -t $out/include/lpsolve
rm $out/lib/liblpsolve*.a
rm $out/include/lpsolve/lp_solveDLL.h # A Windows header
runHook postInstall
'';
meta = with lib; {
description = "Mixed Integer Linear Programming (MILP) solver";
mainProgram = "lp_solve";
homepage = "https://lpsolve.sourceforge.net";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ smironov ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,86 @@
Based on upstream https://sourceforge.net/p/maxima/code/ci/51704ccb090f6f971b641e4e0b7c1c22c4828bf7/
adjusted to apply to 5.47.0
diff --git a/src/gnuplot_def.lisp b/src/gnuplot_def.lisp
index 80c174bd5..6fdc8da6d 100644
--- a/src/gnuplot_def.lisp
+++ b/src/gnuplot_def.lisp
@@ -286,7 +286,7 @@
(format nil "set term postscript eps color solid lw 2 size 16.4 cm, 12.3 cm font \",24\" ~a" gstrings)))
(if (getf plot-options :gnuplot_out_file)
(setq out-file (getf plot-options :gnuplot_out_file))
- (setq out-file "maxplot.ps")))
+ (setq out-file (format nil "~a.ps" (random-name 16)))))
((eq (getf plot-options :gnuplot_term) '$dumb)
(if (getf plot-options :gnuplot_dumb_term_command)
(setq terminal-command
@@ -294,7 +294,7 @@
(setq terminal-command "set term dumb 79 22"))
(if (getf plot-options :gnuplot_out_file)
(setq out-file (getf plot-options :gnuplot_out_file))
- (setq out-file "maxplot.txt")))
+ (setq out-file (format nil "~a.txt" (random-name 16)))))
((eq (getf plot-options :gnuplot_term) '$default)
(if (getf plot-options :gnuplot_default_term_command)
(setq terminal-command
diff --git a/src/plot.lisp b/src/plot.lisp
index fb2b3136b..8877f7025 100644
--- a/src/plot.lisp
+++ b/src/plot.lisp
@@ -1755,16 +1755,24 @@ plot3d([cos(y)*(10.0+6*cos(x)), sin(y)*(10.0+6*cos(x)),-6*sin(x)],
(defvar $xmaxima_plot_command "xmaxima")
+;; random-file-name
+;; Creates a random word of 'count' alphanumeric characters
+(defun random-name (count)
+ (let ((chars "0123456789abcdefghijklmnopqrstuvwxyz") (name ""))
+ (setf *random-state* (make-random-state t))
+ (dotimes (i count)
+ (setq name (format nil "~a~a" name (aref chars (random 36)))))
+ name))
+
(defun plot-set-gnuplot-script-file-name (options)
(let ((gnuplot-term (getf options :gnuplot_term))
(gnuplot-out-file (getf options :gnuplot_out_file)))
(if (and (find (getf options :plot_format) '($gnuplot_pipes $gnuplot))
(eq gnuplot-term '$default) gnuplot-out-file)
(plot-file-path gnuplot-out-file t options)
- (plot-file-path
- (format nil "maxout~d.~(~a~)"
- (getpid)
- (ensure-string (getf options :plot_format))) nil options))))
+ (plot-file-path (format nil "~a.~a" (random-name 16)
+ (ensure-string (getf options :plot_format)))
+ nil options))))
(defun plot-temp-file0 (file &optional (preserve-file nil))
(let ((filename
@@ -2577,9 +2585,13 @@ plot2d ( x^2+y^2 = 1, [x, -2, 2], [y, -2 ,2]);
(format dest "}~%"))
(format dest "}~%"))
+; TODO: Check whether this function is still being used (villate 20240325)
(defun show-open-plot (ans file)
(cond ($show_openplot
- (with-open-file (st1 (plot-temp-file (format nil "maxout~d.xmaxima" (getpid))) :direction :output :if-exists :supersede)
+ (with-open-file
+ (st1 (plot-temp-file
+ (format nil "~a.xmaxima" (random-name 16)))
+ :direction :output :if-exists :supersede)
(princ ans st1))
($system (concatenate 'string *maxima-prefix*
(if (string= *autoconf-windows* "true") "\\bin\\" "/bin/")
diff --git a/src/xmaxima_def.lisp b/src/xmaxima_def.lisp
index b6513b564..5a13b6141 100644
--- a/src/xmaxima_def.lisp
+++ b/src/xmaxima_def.lisp
@@ -431,7 +431,7 @@
(format $pstream "}~%"))))))
(defmethod plot-shipout ((plot xmaxima-plot) options &optional output-file)
- (let ((file (plot-file-path (format nil "maxout~d.xmaxima" (getpid)))))
+ (let ((file (plot-file-path (format nil "~a.xmaxima" (random-name 16)))))
(cond ($show_openplot
(with-open-file (fl
#+sbcl (sb-ext:native-namestring file)

View File

@@ -0,0 +1,125 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
texinfo,
perl,
python3,
makeWrapper,
autoreconfHook,
rlwrap ? null,
tk ? null,
gnuplot ? null,
lisp-compiler,
}:
let
# Allow to remove some executables from the $PATH of the wrapped binary
searchPath = lib.makeBinPath (
lib.filter (x: x != null) [
lisp-compiler
rlwrap
tk
gnuplot
]
);
in
stdenv.mkDerivation (finalAttrs: {
pname = "maxima";
version = "5.47.0";
src = fetchurl {
url = "mirror://sourceforge/maxima/maxima-${finalAttrs.version}.tar.gz";
sha256 = "sha256-kQQCGyT9U+jAOpg1CctC6TepJejAyFwzXXcJoU/UD3o=";
};
nativeBuildInputs = [
autoreconfHook
lisp-compiler
makeWrapper
python3
texinfo
];
strictDeps = true;
nativeCheckInputs = [
gnuplot
];
postPatch = ''
substituteInPlace doc/info/Makefile.am --replace "/usr/bin/env perl" "${perl}/bin/perl"
'';
postInstall = ''
# Make sure that maxima can find its runtime dependencies.
for prog in "$out/bin/"*; do
wrapProgram "$prog" --prefix PATH ":" "$out/bin:${searchPath}"
done
# Move documentation into the right place.
mkdir -p $out/share/doc
ln -s ../maxima/${finalAttrs.version}/doc $out/share/doc/maxima
''
+ (lib.optionalString (lisp-compiler.pname == "ecl") ''
cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${finalAttrs.version}/binary-ecl/"
'');
patches = [
# fix path to info dir (see https://trac.sagemath.org/ticket/11348)
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/infodir.patch";
sha256 = "09v64n60f7i6frzryrj0zd056lvdpms3ajky4f9p6kankhbiv21x";
})
# fix https://sourceforge.net/p/maxima/bugs/2596/
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/matrixexp.patch";
sha256 = "06961hn66rhjijfvyym21h39wk98sfxhp051da6gz0n9byhwc6zg";
})
# undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca
# see https://trac.sagemath.org/ticket/13364#comment:93
(fetchpatch {
url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch";
sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
})
./5.47.0-CVE-2024-34490.patch
];
# The test suite is disabled since 5.42.2 because of the following issues:
#
# Error(s) found:
# /build/maxima-5.44.0/share/linearalgebra/rtest_matrixexp.mac problems:
# (20 21 22)
# Tests that were expected to fail but passed:
# /build/maxima-5.44.0/share/vector/rtest_vect.mac problem:
# (19)
# 3 tests failed out of 16,184 total tests.
#
# These failures don't look serious. It would be nice to fix them, but I
# don't know how and probably won't have the time to find out.
doCheck = false; # try to re-enable after next version update
enableParallelBuilding = true;
passthru = {
inherit lisp-compiler;
};
meta = with lib; {
description = "Computer algebra system";
homepage = "http://maxima.sourceforge.net";
license = licenses.gpl2Plus;
longDescription = ''
Maxima is a fairly complete computer algebra system written in
lisp with an emphasis on symbolic computation. It is based on
DOE-MACSYMA and licensed under the GPL. Its abilities include
symbolic integration, 3D plotting, and an ODE solver.
'';
maintainers = with maintainers; [ doronbehar ];
platforms = platforms.unix;
};
})

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
bison,
flex,
gitUpdater,
gmp,
gtk3,
pkg-config,
qtbase,
wrapQtAppsHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mpsolve";
version = "3.2.2";
src = fetchFromGitHub {
owner = "robol";
repo = "MPSolve";
rev = "de7ebfc7afc4834a0c9f92a04be7abdf5943d446";
hash = "sha256-BGXvNxWUbto0yMIpEIxZ9wOYv9w0ev4OgVcniNYIKoU=";
};
nativeBuildInputs = [
autoreconfHook
bison
flex
pkg-config
wrapQtAppsHook
];
buildInputs = [
gmp
gtk3
qtbase
];
passthru.updateScript = gitUpdater { };
meta = {
homepage = "https://numpi.dm.unipi.it/scientific-computing-libraries/mpsolve/";
description = "Multiprecision Polynomial Solver";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ kilianar ];
mainProgram = "mpsolve";
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,157 @@
{
lib,
stdenv,
autoPatchelfHook,
requireFile,
alsa-lib,
dbus,
fontconfig,
freetype,
gcc,
glib,
installShellFiles,
libssh2,
ncurses,
opencv4,
openssl,
unixODBC,
xkeyboard_config,
xorg,
zlib,
libxml2,
libuuid,
lang ? "en",
libGL,
libGLU,
wrapQtAppsHook,
}:
let
l10n = import ./l10ns.nix {
lib = lib;
inherit requireFile lang;
};
dirName = "WolframEngine";
in
stdenv.mkDerivation rec {
inherit (l10n) version name src;
nativeBuildInputs = [
autoPatchelfHook
installShellFiles
wrapQtAppsHook
];
dontWrapQtApps = true;
buildInputs = [
alsa-lib
dbus
fontconfig
freetype
gcc.cc
gcc.libc
glib
libssh2
ncurses
opencv4
openssl
(lib.getLib stdenv.cc.cc)
unixODBC
xkeyboard_config
libxml2
libuuid
zlib
libGL
libGLU
]
++ (with xorg; [
libX11
libXext
libXtst
libXi
libXmu
libXrender
libxcb
libXcursor
libXfixes
libXrandr
libICE
libSM
]);
# some bundled libs are found through LD_LIBRARY_PATH
autoPatchelfIgnoreMissingDeps = true;
ldpath =
lib.makeLibraryPath buildInputs
+ lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") (
":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs
);
unpackPhase = ''
# find offset from file
offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
dd if="$src" ibs=$offset skip=1 | tar -xf -
cd Unix
'';
installPhase = ''
cd Installer
sed -i -e 's/^PATH=/# PATH=/' -e 's/=`id -[ug]`/=0/' MathInstaller
# Installer wants to write default config in HOME
export HOME=$(mktemp -d)
# Fix the installation script
patchShebangs MathInstaller
substituteInPlace MathInstaller \
--replace-fail '`hostname`' "" \
--replace-fail "chgrp" "# chgrp" \
--replace-fail "chown" ": # chown"
# Install the desktop items
export XDG_DATA_HOME="$out/share"
./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/${dirName} -silent
# Fix library paths
cd $out/libexec/${dirName}/Executables
for path in MathKernel math mcc wolfram; do
makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
done
for path in WolframKernel wolframscript; do
makeWrapper $out/libexec/${dirName}/SystemFiles/Kernel/Binaries/Linux-x86-64/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
done
wrapQtApp "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer" \
--set LD_LIBRARY_PATH "${zlib}/lib:${lib.getLib stdenv.cc.cc}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}" \
--set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb"
if ! isELF "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer"; then
substituteInPlace $out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer \
--replace-fail "TopDirectory=" "TopDirectory=$out/libexec/${dirName} #";
fi
for path in WolframPlayer wolframplayer; do
makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path
done
# Install man pages
installManPage $out/libexec/${dirName}/SystemFiles/SystemDocumentation/Unix/*
'';
# This is primarily an IO bound build; there's little benefit to building remotely.
preferLocalBuild = true;
# Stripping causes the program to core dump.
dontStrip = true;
meta = with lib; {
description = "Wolfram Engine computational software system";
homepage = "https://www.wolfram.com/engine/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ fbeffa ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,88 @@
{
lib,
requireFile,
lang,
majorVersion ? null,
}:
let
allVersions =
lib.flip map
# N.B. Versions in this list should be ordered from newest to oldest.
[
{
version = "14.1.0";
lang = "en";
language = "English";
sha256 = "1kxdvm3i7nn3ws784y972h2br1n0y82kkkjvz7c5llssv6d3pgj8";
installer = "WolframEngine_14.1.0_LIN.sh";
}
{
version = "13.3.0";
lang = "en";
language = "English";
sha256 = "96106ac8ed6d0e221a68d846117615c14025320f927e5e0ed95b1965eda68e31";
installer = "WolframEngine_13.3.0_LINUX.sh";
}
{
version = "13.2.0";
lang = "en";
language = "English";
sha256 = "1xvg1n64iq52jxnk9y551m5iwkkz6cxzwyw28h8d0kq36aaiky24";
installer = "WolframEngine_13.2.0_LINUX.sh";
}
{
version = "13.1.0";
lang = "en";
language = "English";
sha256 = "1659kyp38a8xknic95pynx9fsgn96i8jn9lnk89pc8n6vydw1460";
installer = "WolframEngine_13.1.0_LINUX.sh";
}
{
version = "13.0.1";
lang = "en";
language = "English";
sha256 = "1rrxi7d51m02407k719fq829jzanh550wr810i22n3irhk8axqga";
installer = "WolframEngine_13.0.1_LINUX.sh";
}
{
version = "13.0.0";
lang = "en";
language = "English";
sha256 = "10cpwllz9plxz22iqdh6xgkxqphl9s9nq8ax16pafjll6j9kqy1q";
installer = "WolframEngine_13.0.0_LINUX.sh";
}
]
(
{
version,
lang,
language,
sha256,
installer,
}:
{
inherit version lang;
name = "wolfram-engine-${version}" + lib.optionalString (lang != "en") "-${lang}";
src = requireFile {
name = installer;
message = ''
This nix expression requires that ${installer} is
already part of the store. Download the file from
https://www.wolfram.com/engine/ and add it to the nix store
with nix-store --add-fixed sha256 <FILE>.
'';
inherit sha256;
};
}
);
minVersion =
if majorVersion == null then
lib.elemAt (builtins.splitVersion (lib.elemAt allVersions 0).version) 0
else
majorVersion;
maxVersion = toString (1 + builtins.fromJSON minVersion);
in
lib.findFirst (
l: (l.lang == lang && l.version >= minVersion && l.version < maxVersion)
) (throw "Version ${minVersion} in language ${lang} not supported") allVersions

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
wrapGAppsHook3,
cmake,
gettext,
maxima,
wxGTK,
adwaita-icon-theme,
glib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "wxmaxima";
version = "25.04.0";
src = fetchFromGitHub {
owner = "wxMaxima-developers";
repo = "wxmaxima";
rev = "Version-${finalAttrs.version}";
hash = "sha256-AEy2a8BahV1yH67RIjcsVipuo5eUZcQZxR3HygSYGlU=";
};
buildInputs = [
wxGTK
maxima
# So it won't embed svg files into headers.
adwaita-icon-theme
# So it won't crash under Sway.
glib
];
nativeBuildInputs = [
wrapGAppsHook3
cmake
gettext
];
cmakeFlags = [
"-DwxWidgets_LIBRARIES=${wxGTK}/lib"
];
preConfigure = ''
gappsWrapperArgs+=(--prefix PATH ":" ${maxima}/bin)
'';
meta = with lib; {
description = "Cross platform GUI for the computer algebra system Maxima";
mainProgram = "wxmaxima";
license = licenses.gpl2;
homepage = "https://wxmaxima-developers.github.io/wxmaxima/";
maintainers = with maintainers; [ doronbehar ];
platforms = platforms.linux;
};
})

View File

@@ -0,0 +1,90 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
perl,
enableGui ? false,
qtbase,
wrapQtAppsHook,
qtwebengine,
enableJupyter ? true,
boost,
jsoncpp,
openssl,
zmqpp,
enableJava ? false,
openjdk,
gtest,
}:
stdenv.mkDerivation rec {
pname = "yacas";
version = "1.9.1";
src = fetchFromGitHub {
owner = "grzegorzmazur";
repo = "yacas";
rev = "v${version}";
sha256 = "0dqgqvsb6ggr8jb3ngf0jwfkn6xwj2knhmvqyzx3amc74yd3ckqx";
};
hardeningDisable = [ "format" ];
cmakeFlags = [
"-DENABLE_CYACAS_GUI=${if enableGui then "ON" else "OFF"}"
"-DENABLE_CYACAS_KERNEL=${if enableJupyter then "ON" else "OFF"}"
"-DENABLE_JYACAS=${if enableJava then "ON" else "OFF"}"
"-DENABLE_CYACAS_UNIT_TESTS=ON"
];
patches = [
# upstream issue: https://github.com/grzegorzmazur/yacas/issues/340
# Upstream patch which doesn't apply on 1.9.1 is:
# https://github.com/grzegorzmazur/yacas/pull/342
./jsoncpp-fix-include.patch
# Fixes testing - https://github.com/grzegorzmazur/yacas/issues/339
# PR: https://github.com/grzegorzmazur/yacas/pull/343
(fetchpatch {
url = "https://github.com/grzegorzmazur/yacas/commit/8bc22d517ecfdde3ac94800dc8506f5405564d48.patch";
sha256 = "sha256-aPO5T8iYNkGtF8j12YxNJyUPJJPKrXje1DmfCPt317A=";
})
];
preCheck = ''
patchShebangs ../tests/test-yacas
'';
nativeCheckInputs = [
gtest
];
doCheck = true;
nativeBuildInputs = [
cmake
# Perl is only for the documentation
perl
]
++ lib.optionals enableJava [
openjdk
];
buildInputs = [
]
++ lib.optionals enableGui [
qtbase
wrapQtAppsHook
qtwebengine
]
++ lib.optionals enableJupyter [
boost
jsoncpp
openssl
zmqpp
];
meta = {
description = "Easy to use, general purpose Computer Algebra System, optionally with GUI";
homepage = "http://www.yacas.org/";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = with lib.platforms; linux;
};
}

View File

@@ -0,0 +1,63 @@
diff --git i/cyacas/yacas-kernel/CMakeLists.txt w/cyacas/yacas-kernel/CMakeLists.txt
index fe1600aa..dcc329f8 100644
--- i/cyacas/yacas-kernel/CMakeLists.txt
+++ w/cyacas/yacas-kernel/CMakeLists.txt
@@ -22,8 +22,9 @@ find_library (ZEROMQ_LIBRARY NAMES zmq)
find_path (ZMQPP_INCLUDE_DIR zmqpp.hpp)
find_library (ZMQPP_LIBRARY NAMES zmqpp)
-find_path (JSONCPP_INCLUDE_DIR json.h)
-find_library (JSONCPP_LIBRARY NAMES jsoncpp)
+# https://github.com/open-source-parsers/jsoncpp/wiki/Building#another-approach-for-cmake
+find_package(jsoncpp REQUIRED)
+get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
find_package (OpenSSL)
find_package (Boost REQUIRED date_time filesystem)
@@ -31,6 +32,6 @@ find_package (Boost REQUIRED date_time filesystem)
include_directories (include)
add_executable (yacas-kernel src/main.cpp src/yacas_kernel.cpp src/yacas_engine.cpp src/hmac_sha256.cpp src/base64.cpp)
-target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} ${JSONCPP_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
+target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} jsoncpp_lib ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
install (TARGETS yacas-kernel DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git i/cyacas/yacas-kernel/include/yacas_kernel.hpp w/cyacas/yacas-kernel/include/yacas_kernel.hpp
index 91d36ac0..d12f905c 100644
--- i/cyacas/yacas-kernel/include/yacas_kernel.hpp
+++ w/cyacas/yacas-kernel/include/yacas_kernel.hpp
@@ -29,7 +29,7 @@
#include "yacas_engine.hpp"
#include <boost/uuid/random_generator.hpp>
-#include <jsoncpp/json/json.h>
+#include <json/json.h>
#include <zmqpp/zmqpp.hpp>
#include <map>
diff --git i/cyacas/yacas-kernel/src/main.cpp w/cyacas/yacas-kernel/src/main.cpp
index c31f17f2..832e9128 100644
--- i/cyacas/yacas-kernel/src/main.cpp
+++ w/cyacas/yacas-kernel/src/main.cpp
@@ -24,7 +24,7 @@
#include "yacas_kernel.hpp"
-#include <jsoncpp/json/json.h>
+#include <json/json.h>
#include <boost/dll/runtime_symbol_info.hpp>
diff --git i/cyacas/yacas-kernel/src/yacas_engine.cpp w/cyacas/yacas-kernel/src/yacas_engine.cpp
index 6ed60ca3..18e9b3fd 100644
--- i/cyacas/yacas-kernel/src/yacas_engine.cpp
+++ w/cyacas/yacas-kernel/src/yacas_engine.cpp
@@ -22,7 +22,7 @@
* Created on November 7, 2015, 12:52 PM
*/
-#include <jsoncpp/json/writer.h>
+#include <json/writer.h>
#include "yacas_engine.hpp"

View File

@@ -0,0 +1,28 @@
{
lib,
flutter329,
fetchFromGitHub,
}:
flutter329.buildFlutterApplication rec {
pname = "convertall";
version = "1.0.2";
src = fetchFromGitHub {
owner = "doug-101";
repo = "ConvertAll";
tag = "v${version}";
hash = "sha256-esc2xhL0Jx5SaqM0GnnVzdtnSN9bX8zln66We/2RqoA=";
};
pubspecLock = lib.importJSON ./pubspec.lock.json;
meta = {
homepage = "https://convertall.bellz.org";
description = "Graphical unit converter";
mainProgram = "convertall";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ orivej ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,792 @@
{
"packages": {
"archive": {
"dependency": "transitive",
"description": {
"name": "archive",
"sha256": "a7f37ff061d7abc2fcf213554b9dcaca713c5853afa5c065c44888bc9ccaf813",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "4.0.6"
},
"args": {
"dependency": "transitive",
"description": {
"name": "args",
"sha256": "d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.7.0"
},
"async": {
"dependency": "direct main",
"description": {
"name": "async",
"sha256": "d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.12.0"
},
"boolean_selector": {
"dependency": "transitive",
"description": {
"name": "boolean_selector",
"sha256": "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.2"
},
"characters": {
"dependency": "transitive",
"description": {
"name": "characters",
"sha256": "f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.4.0"
},
"checked_yaml": {
"dependency": "transitive",
"description": {
"name": "checked_yaml",
"sha256": "feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.0.3"
},
"cli_util": {
"dependency": "transitive",
"description": {
"name": "cli_util",
"sha256": "ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.4.2"
},
"clock": {
"dependency": "transitive",
"description": {
"name": "clock",
"sha256": "fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.1.2"
},
"collection": {
"dependency": "transitive",
"description": {
"name": "collection",
"sha256": "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.19.1"
},
"crypto": {
"dependency": "transitive",
"description": {
"name": "crypto",
"sha256": "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.6"
},
"cupertino_icons": {
"dependency": "transitive",
"description": {
"name": "cupertino_icons",
"sha256": "ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.0.8"
},
"decimal": {
"dependency": "direct main",
"description": {
"name": "decimal",
"sha256": "24a261d5d5c87e86c7651c417a5dbdf8bcd7080dd592533910e8d0505a279f21",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.3.3"
},
"eval_ex": {
"dependency": "direct main",
"description": {
"name": "eval_ex",
"sha256": "3f8853d996ee41955f2232ad3730e95698fb1040d03f6ebc6ab01f1c2bc3be53",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.1.8"
},
"fake_async": {
"dependency": "transitive",
"description": {
"name": "fake_async",
"sha256": "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.3.2"
},
"ffi": {
"dependency": "transitive",
"description": {
"name": "ffi",
"sha256": "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.4"
},
"file": {
"dependency": "transitive",
"description": {
"name": "file",
"sha256": "a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "7.0.1"
},
"flutter": {
"dependency": "direct main",
"description": "flutter",
"source": "sdk",
"version": "0.0.0"
},
"flutter_launcher_icons": {
"dependency": "direct dev",
"description": {
"name": "flutter_launcher_icons",
"sha256": "bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.14.3"
},
"flutter_lints": {
"dependency": "direct dev",
"description": {
"name": "flutter_lints",
"sha256": "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.2"
},
"flutter_markdown_selectionarea": {
"dependency": "direct main",
"description": {
"name": "flutter_markdown_selectionarea",
"sha256": "d4bc27e70a5c40ebdab23a4b81f75d53696a214d4d1f13c12045b38a0ddc58a2",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.6.17+1"
},
"flutter_spinbox": {
"dependency": "direct main",
"description": {
"name": "flutter_spinbox",
"sha256": "38d8c1a3a39f0fa72823d4470785f5e165f2deb53531ca7803b54ba45e4dbd46",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.13.1"
},
"flutter_test": {
"dependency": "direct dev",
"description": "flutter",
"source": "sdk",
"version": "0.0.0"
},
"flutter_web_plugins": {
"dependency": "transitive",
"description": "flutter",
"source": "sdk",
"version": "0.0.0"
},
"http": {
"dependency": "transitive",
"description": {
"name": "http",
"sha256": "fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.3.0"
},
"http_parser": {
"dependency": "transitive",
"description": {
"name": "http_parser",
"sha256": "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "4.1.2"
},
"image": {
"dependency": "transitive",
"description": {
"name": "image",
"sha256": "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "4.5.4"
},
"json_annotation": {
"dependency": "transitive",
"description": {
"name": "json_annotation",
"sha256": "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "4.9.0"
},
"leak_tracker": {
"dependency": "transitive",
"description": {
"name": "leak_tracker",
"sha256": "c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "10.0.8"
},
"leak_tracker_flutter_testing": {
"dependency": "transitive",
"description": {
"name": "leak_tracker_flutter_testing",
"sha256": "f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.9"
},
"leak_tracker_testing": {
"dependency": "transitive",
"description": {
"name": "leak_tracker_testing",
"sha256": "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.1"
},
"lints": {
"dependency": "transitive",
"description": {
"name": "lints",
"sha256": "cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.0.0"
},
"markdown": {
"dependency": "transitive",
"description": {
"name": "markdown",
"sha256": "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "7.3.0"
},
"matcher": {
"dependency": "transitive",
"description": {
"name": "matcher",
"sha256": "dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.12.17"
},
"material_color_utilities": {
"dependency": "transitive",
"description": {
"name": "material_color_utilities",
"sha256": "f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.11.1"
},
"meta": {
"dependency": "transitive",
"description": {
"name": "meta",
"sha256": "e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.16.0"
},
"nested": {
"dependency": "transitive",
"description": {
"name": "nested",
"sha256": "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.0.0"
},
"package_info_plus": {
"dependency": "direct main",
"description": {
"name": "package_info_plus",
"sha256": "cb44f49b6e690fa766f023d5b22cac6b9affe741dd792b6ac7ad4fabe0d7b097",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.0.0"
},
"package_info_plus_platform_interface": {
"dependency": "transitive",
"description": {
"name": "package_info_plus_platform_interface",
"sha256": "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.0.1"
},
"path": {
"dependency": "transitive",
"description": {
"name": "path",
"sha256": "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.9.1"
},
"path_provider_linux": {
"dependency": "transitive",
"description": {
"name": "path_provider_linux",
"sha256": "f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.2.1"
},
"path_provider_platform_interface": {
"dependency": "transitive",
"description": {
"name": "path_provider_platform_interface",
"sha256": "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.2"
},
"path_provider_windows": {
"dependency": "transitive",
"description": {
"name": "path_provider_windows",
"sha256": "bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.3.0"
},
"petitparser": {
"dependency": "transitive",
"description": {
"name": "petitparser",
"sha256": "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.1.0"
},
"platform": {
"dependency": "transitive",
"description": {
"name": "platform",
"sha256": "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.1.6"
},
"plugin_platform_interface": {
"dependency": "transitive",
"description": {
"name": "plugin_platform_interface",
"sha256": "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.8"
},
"posix": {
"dependency": "transitive",
"description": {
"name": "posix",
"sha256": "f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.0.2"
},
"provider": {
"dependency": "direct main",
"description": {
"name": "provider",
"sha256": "489024f942069c2920c844ee18bb3d467c69e48955a4f32d1677f71be103e310",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.1.4"
},
"rational": {
"dependency": "transitive",
"description": {
"name": "rational",
"sha256": "cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.2.3"
},
"screen_retriever": {
"dependency": "transitive",
"description": {
"name": "screen_retriever",
"sha256": "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.1.9"
},
"shared_preferences": {
"dependency": "direct main",
"description": {
"name": "shared_preferences",
"sha256": "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.5.3"
},
"shared_preferences_android": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_android",
"sha256": "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.10"
},
"shared_preferences_foundation": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_foundation",
"sha256": "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.5.4"
},
"shared_preferences_linux": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_linux",
"sha256": "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.1"
},
"shared_preferences_platform_interface": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_platform_interface",
"sha256": "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.1"
},
"shared_preferences_web": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_web",
"sha256": "c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.3"
},
"shared_preferences_windows": {
"dependency": "transitive",
"description": {
"name": "shared_preferences_windows",
"sha256": "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.1"
},
"sky_engine": {
"dependency": "transitive",
"description": "flutter",
"source": "sdk",
"version": "0.0.0"
},
"source_span": {
"dependency": "transitive",
"description": {
"name": "source_span",
"sha256": "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.10.1"
},
"stack_trace": {
"dependency": "transitive",
"description": {
"name": "stack_trace",
"sha256": "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.12.1"
},
"stream_channel": {
"dependency": "transitive",
"description": {
"name": "stream_channel",
"sha256": "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.4"
},
"string_scanner": {
"dependency": "transitive",
"description": {
"name": "string_scanner",
"sha256": "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.4.1"
},
"term_glyph": {
"dependency": "transitive",
"description": {
"name": "term_glyph",
"sha256": "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.2.2"
},
"test_api": {
"dependency": "transitive",
"description": {
"name": "test_api",
"sha256": "fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.7.4"
},
"typed_data": {
"dependency": "transitive",
"description": {
"name": "typed_data",
"sha256": "f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.4.0"
},
"url_launcher": {
"dependency": "direct main",
"description": {
"name": "url_launcher",
"sha256": "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.3.1"
},
"url_launcher_android": {
"dependency": "transitive",
"description": {
"name": "url_launcher_android",
"sha256": "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.3.16"
},
"url_launcher_ios": {
"dependency": "transitive",
"description": {
"name": "url_launcher_ios",
"sha256": "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.3.3"
},
"url_launcher_linux": {
"dependency": "transitive",
"description": {
"name": "url_launcher_linux",
"sha256": "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.2.1"
},
"url_launcher_macos": {
"dependency": "transitive",
"description": {
"name": "url_launcher_macos",
"sha256": "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.2.2"
},
"url_launcher_platform_interface": {
"dependency": "transitive",
"description": {
"name": "url_launcher_platform_interface",
"sha256": "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.3.2"
},
"url_launcher_web": {
"dependency": "transitive",
"description": {
"name": "url_launcher_web",
"sha256": "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.4.0"
},
"url_launcher_windows": {
"dependency": "transitive",
"description": {
"name": "url_launcher_windows",
"sha256": "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.1.4"
},
"vector_math": {
"dependency": "transitive",
"description": {
"name": "vector_math",
"sha256": "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "2.1.4"
},
"vm_service": {
"dependency": "transitive",
"description": {
"name": "vm_service",
"sha256": "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "14.3.1"
},
"web": {
"dependency": "transitive",
"description": {
"name": "web",
"sha256": "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.5.1"
},
"win32": {
"dependency": "transitive",
"description": {
"name": "win32",
"sha256": "dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "5.12.0"
},
"window_manager": {
"dependency": "direct main",
"description": {
"name": "window_manager",
"sha256": "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "0.3.9"
},
"xdg_directories": {
"dependency": "transitive",
"description": {
"name": "xdg_directories",
"sha256": "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "1.1.0"
},
"xml": {
"dependency": "transitive",
"description": {
"name": "xml",
"sha256": "b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "6.5.0"
},
"yaml": {
"dependency": "transitive",
"description": {
"name": "yaml",
"sha256": "b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce",
"url": "https://pub.dev"
},
"source": "hosted",
"version": "3.1.3"
}
},
"sdks": {
"dart": ">=3.7.0 <4.0.0",
"flutter": ">=3.27.0"
}
}

View File

@@ -0,0 +1,89 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
doxygen,
graphviz,
boost,
cgal,
gdal,
glew,
gmp,
libGL,
libGLU,
libSM,
mpfr,
proj,
python3,
qtxmlpatterns,
qwt,
wrapQtAppsHook,
}:
let
python = python3.withPackages (
ps: with ps; [
numpy
]
);
boost' = boost.override {
enablePython = true;
inherit python;
};
cgal' = cgal.override {
boost = boost';
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "gplates";
version = "2.5";
src = fetchFromGitHub {
owner = "GPlates";
repo = "GPlates";
rev = "GPlates-${finalAttrs.version}";
hash = "sha256-3fEwm5EKK9RcRbnyUejgwfjdsXaujjZjoMbq/BbVMeM=";
};
patches = [
(fetchpatch {
name = "qwt-6.3-compile-error-fix.patch";
url = "https://github.com/GPlates/GPlates/commit/c4680ebe54f4535909085feacecd66410a91ff98.patch";
hash = "sha256-mw5+GLayMrmcSDd1ai+0JTuY3iedHT9u2kx5Dd2wMjg=";
})
];
nativeBuildInputs = [
cmake
doxygen
graphviz
wrapQtAppsHook
];
buildInputs = [
boost'
cgal'
gdal
glew
gmp
libGL
libGLU
libSM
mpfr
proj
python
qtxmlpatterns
qwt
];
meta = with lib; {
description = "Desktop software for the interactive visualisation of plate-tectonics";
mainProgram = "gplates";
homepage = "https://www.gplates.org";
license = licenses.gpl2Only;
platforms = platforms.all;
broken = stdenv.hostPlatform.isDarwin; # FIX: this check: https://github.com/GPlates/GPlates/blob/gplates/cmake/modules/Config_h.cmake#L72
};
})

View File

@@ -0,0 +1,49 @@
{
stdenv,
lib,
cmake,
git,
fetchFromGitHub,
wrapQtAppsHook,
qtbase,
qtdeclarative,
qtsvg,
qtwebengine,
}:
stdenv.mkDerivation rec {
pname = "graphia";
version = "5.2";
src = fetchFromGitHub {
owner = "graphia-app";
repo = "graphia";
rev = version;
sha256 = "sha256-tS5oqpwpqvWGu67s8OuA4uQR3Zb5VzHTY/GnfVQki6k=";
};
nativeBuildInputs = [
cmake
git # needs to define some hash as a version
wrapQtAppsHook
];
buildInputs = [
qtbase
qtdeclarative
qtsvg
qtwebengine
];
meta = with lib; {
# never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/graphia.x86_64-darwin
broken =
(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin;
description = "Visualisation tool for the creation and analysis of graphs";
homepage = "https://graphia.app";
license = licenses.gpl3Only;
mainProgram = "Graphia";
maintainers = [ maintainers.bgamari ];
platforms = platforms.all;
};
}

Some files were not shown because too many files have changed in this diff Show More