eukleides: unbreak, switch to mirror

This commit is contained in:
Petr Zahradnik 2025-06-08 14:36:32 +02:00
parent dbe4980a89
commit 055b892a4f
2 changed files with 47 additions and 10 deletions

View file

@ -1,23 +1,28 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitLab,
bison,
flex,
makeWrapper,
texinfo4,
getopt,
readline,
texinfo,
texlive,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "eukleides";
version = "1.5.4";
src = fetchurl {
url = "http://www.eukleides.org/files/eukleides-${finalAttrs.version}.tar.bz2";
sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q";
src = fetchFromGitLab {
# official upstream www.eukleides.org is down
domain = "salsa.debian.org";
owner = "georgesk";
repo = "eukleides";
rev = "upstream/${finalAttrs.version}";
hash = "sha256-keX7k14X/97zHh87A/7vUsfGc/S6fByd+rewW+LkJeM=";
};
patches = [
@ -25,12 +30,14 @@ stdenv.mkDerivation (finalAttrs: {
./use-CC.patch
# allow PostScript transparency in epstopdf call
./gs-allowpstransparency.patch
# fix curly brace escaping in eukleides.texi for newer texinfo compatiblity
./texinfo-escape.patch
];
nativeBuildInputs = [
bison
flex
texinfo4
texinfo
makeWrapper
];
@ -41,14 +48,14 @@ stdenv.mkDerivation (finalAttrs: {
preConfigure = ''
substituteInPlace Makefile \
--replace mktexlsr true
--replace-fail mktexlsr true
substituteInPlace doc/Makefile \
--replace ginstall-info install-info
--replace-fail ginstall-info install-info
substituteInPlace Config \
--replace '/usr/local' "$out" \
--replace '$(SHARE_DIR)/texmf' "$tex"
--replace-fail '/usr/local' "$out" \
--replace-fail '$(SHARE_DIR)/texmf' "$tex"
'';
# Workaround build failure on -fno-common toolchains like upstream
@ -57,6 +64,13 @@ stdenv.mkDerivation (finalAttrs: {
# eukleides_build/quadrilateral.o:(.bss+0x18): first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
preBuild = ''
mkdir build/eukleides_build
mkdir build/euktopst_build
'';
enableParallelBuilding = true;
preInstall = ''
mkdir -p $out/bin
'';
@ -84,6 +98,10 @@ stdenv.mkDerivation (finalAttrs: {
pkgs = [ finalAttrs.finalPackage.tex ];
};
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
meta = {
description = "Geometry Drawing Language";
homepage = "http://www.eukleides.org/";

View file

@ -0,0 +1,19 @@
--- a/doc/eukleides.texi
+++ b/doc/eukleides.texi
@@ -6,12 +6,12 @@
% ------------------------------------------------------------------------------
-\def\LaTeX{L\kern-.34em\raise.49ex\hbox{\sevenrm A}\kern-.18em\TeX}
-\def\mdeg{$^\circ$}
+\def\LaTeX@{L\kern-.34em\raise.49ex\hbox@{\sevenrm A@}\kern-.18em\TeX@}
+\def\mdeg@{$^\circ$@}
\font\degfont=cmtt8
-\def\deg{\raise.7ex\hbox{\degfont o}}
-\def\exm#1{\noindent{\textit Example:}\quad{\texttt #1}}
-\def\exmp{\noindent{\textit Example:}}
+\def\deg@{\raise.7ex\hbox@{\degfont o@}@}
+\def\exm#1@{\noindent@{\textit Example:@}\quad@{\texttt #1@}@}
+\def\exmp@{\noindent@{\textit Example:@}@}
% ------------------------------------------------------------------------------