tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
dia: 0.97.3.20170622 -> unstable-2022-12-14
Thiago Kenji Okada
3 years ago
467e2a23
b29899b8
+148
-40
4 changed files
expand all
collapse all
unified
split
pkgs
applications
graphics
dia
CVE-2019-19451.patch
default.nix
poppler-22_09-build-fix.patch
top-level
all-packages.nix
-11
pkgs/applications/graphics/dia/CVE-2019-19451.patch
···
1
1
-
diff -ru a/app/app_procs.c b/app/app_procs.c
2
2
-
--- a/app/app_procs.c 2021-01-30 11:09:52.000000000 -0500
3
3
-
+++ b/app/app_procs.c 2021-01-30 11:11:05.000000000 -0500
4
4
-
@@ -785,6 +785,7 @@
5
5
-
6
6
-
if (!filename) {
7
7
-
g_print (_("Filename conversion failed: %s\n"), filenames[i]);
8
8
-
+ ++i;
9
9
-
continue;
10
10
-
}
11
11
-
+54
-26
pkgs/applications/graphics/dia/default.nix
···
1
1
-
{ lib, stdenv, fetchgit, autoconf, automake, libtool, gtk2, pkg-config, perlPackages,
2
2
-
libxml2, gettext, python2, libxml2Python, docbook5, docbook_xsl,
3
3
-
libxslt, intltool, libart_lgpl, withGNOME ? false, libgnomeui,
4
4
-
gtk-mac-integration-gtk2 }:
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitLab
4
4
+
, appstream-glib
5
5
+
, cmake
6
6
+
, dblatex
7
7
+
, desktop-file-utils
8
8
+
, graphene
9
9
+
, gtk2
10
10
+
, gtk-mac-integration-gtk2
11
11
+
, intltool
12
12
+
, libxml2
13
13
+
, libxslt
14
14
+
, meson
15
15
+
, ninja
16
16
+
, pkg-config
17
17
+
, poppler
18
18
+
, python3
19
19
+
# Building with docs are failing in unstable-2022-12-14
20
20
+
, withDocs ? false
21
21
+
}:
5
22
6
23
stdenv.mkDerivation {
7
24
pname = "dia";
8
8
-
version = "0.97.3.20170622";
25
25
+
version = "unstable-2022-12-14";
9
26
10
10
-
src = fetchgit {
11
11
-
url = "https://gitlab.gnome.org/GNOME/dia.git";
12
12
-
rev = "b86085dfe2b048a2d37d587adf8ceba6fb8bc43c";
13
13
-
sha256 = "1fyxfrzdcs6blxhkw3bcgkksaf3byrsj4cbyrqgb4869k3ynap96";
27
27
+
src = fetchFromGitLab {
28
28
+
owner = "GNOME";
29
29
+
repo = "dia";
30
30
+
domain = "gitlab.gnome.org";
31
31
+
rev = "4a619ec7cc93be5ddfbcc48d9e1572d04943bcad";
32
32
+
hash = "sha256-xi45Ak4rlDQjs/FNkdkm145mx76GNHjE6Nrs1dc94ww=";
14
33
};
15
34
16
16
-
patches = [
17
17
-
./CVE-2019-19451.patch
18
18
-
];
19
19
-
20
20
-
buildInputs =
21
21
-
[ gtk2 libxml2 gettext python2 libxml2Python docbook5
22
22
-
libxslt docbook_xsl libart_lgpl ]
23
23
-
++ lib.optional withGNOME libgnomeui
24
24
-
++ lib.optional stdenv.isDarwin gtk-mac-integration-gtk2;
25
25
-
26
26
-
nativeBuildInputs = [ autoconf automake libtool pkg-config intltool ]
27
27
-
++ (with perlPackages; [ perl XMLParser ]);
35
35
+
patches = [ ./poppler-22_09-build-fix.patch ];
28
36
29
37
preConfigure = ''
30
30
-
NOCONFIGURE=1 ./autogen.sh # autoreconfHook is not enough
38
38
+
patchShebangs .
31
39
'';
32
32
-
configureFlags = lib.optional withGNOME "--enable-gnome";
33
40
34
34
-
# error: implicitly declaring library function 'finite' with type 'int (double)'
35
35
-
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
41
41
+
buildInputs = [
42
42
+
graphene
43
43
+
gtk2
44
44
+
libxml2
45
45
+
python3
46
46
+
poppler
47
47
+
] ++
48
48
+
lib.optionals withDocs [
49
49
+
libxslt
50
50
+
] ++
51
51
+
lib.optionals stdenv.isDarwin [
52
52
+
gtk-mac-integration-gtk2
53
53
+
];
36
54
37
37
-
hardeningDisable = [ "format" ];
55
55
+
nativeBuildInputs = [
56
56
+
appstream-glib
57
57
+
desktop-file-utils
58
58
+
intltool
59
59
+
meson
60
60
+
ninja
61
61
+
pkg-config
62
62
+
] ++
63
63
+
lib.optionals withDocs [
64
64
+
dblatex
65
65
+
];
38
66
39
67
meta = with lib; {
40
68
description = "Gnome Diagram drawing software";
+93
pkgs/applications/graphics/dia/poppler-22_09-build-fix.patch
···
1
1
+
diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp
2
2
+
index 189737908..a2a479693 100644
3
3
+
--- a/plug-ins/pdf/pdf-import.cpp
4
4
+
+++ b/plug-ins/pdf/pdf-import.cpp
5
5
+
@@ -152,12 +152,12 @@ public :
6
6
+
void
7
7
+
updateLineDash (GfxState *state)
8
8
+
{
9
9
+
- double *dashPattern;
10
10
+
- int dashLength;
11
11
+
- double dashStart;
12
12
+
-
13
13
+
- state->getLineDash (&dashPattern, &dashLength, &dashStart);
14
14
+
- this->dash_length = dashLength ? dashPattern[0] * scale : 1.0;
15
15
+
+ const double *dashPattern=NULL;
16
16
+
+ int dashLength=0;
17
17
+
+ double dashStart=0;
18
18
+
+ const std::vector<double> &dash = state->getLineDash(&dashStart); // > Poppler 22.09 ...
19
19
+
+ dashPattern = dash.data();
20
20
+
+ dashLength = dash.size();
21
21
+
22
22
+
if (dashLength == 0)
23
23
+
this->line_style = DIA_LINE_STYLE_SOLID;
24
24
+
@@ -318,10 +318,11 @@ public :
25
25
+
//FIXME: Dia is really unhappy about zero size fonts
26
26
+
if (!(state->getFontSize() > 0.0))
27
27
+
return;
28
28
+
- GfxFont *f = state->getFont();
29
29
+
+ const std::shared_ptr<GfxFont> f = state->getFont(); // poppler 22.05 ... header changed
30
30
+
+ gconstpointer f1 = &f; // GLib typedef const void * gconstpointer;
31
31
+
32
32
+
// instead of building the same font over and over again
33
33
+
- if (g_hash_table_lookup (this->font_map, f)) {
34
34
+
+ if (g_hash_table_lookup (this->font_map, f1)) {
35
35
+
++font_map_hits;
36
36
+
return;
37
37
+
}
38
38
+
@@ -333,8 +334,9 @@ public :
39
39
+
gchar *family = g_strdup (f->getFamily() ? f->getFamily()->c_str() : "sans");
40
40
+
41
41
+
// we are (not anymore) building the same font over and over again
42
42
+
+ f1 = &f;
43
43
+
g_print ("Font 0x%x: '%s' size=%g (* %g)\n",
44
44
+
- GPOINTER_TO_INT (f), family, state->getTransformedFontSize(), scale);
45
45
+
+ GPOINTER_TO_INT (f1), family, state->getTransformedFontSize(), scale);
46
46
+
47
47
+
// now try to make a fontname Dia/Pango can cope with
48
48
+
// strip style postfix - we already have extracted the style bits above
49
49
+
@@ -354,7 +356,9 @@ public :
50
50
+
fsize *= fabs(fm[3] / fm[0]);
51
51
+
font = dia_font_new (family, style, fsize * scale / 0.8);
52
52
+
53
53
+
- g_hash_table_insert (this->font_map, f, font);
54
54
+
+ f1 = &f;
55
55
+
+ gpointer f2 = (gpointer)f1; // GLib typedef void* gpointer;
56
56
+
+ g_hash_table_insert (this->font_map, f2, font);
57
57
+
g_free (family);
58
58
+
}
59
59
+
void updateTextShift(GfxState *state, double shift)
60
60
+
@@ -721,11 +725,12 @@ DiaOutputDev::drawString(GfxState *state, GooString *s)
61
61
+
return;
62
62
+
if (!(state->getFontSize() > 0.0))
63
63
+
return;
64
64
+
- font = (DiaFont *)g_hash_table_lookup (this->font_map, state->getFont());
65
65
+
+ gconstpointer f_1 = &state->getFont();
66
66
+
+ font = (DiaFont *)g_hash_table_lookup (this->font_map, f_1);
67
67
+
68
68
+
// we have to decode the string data first
69
69
+
{
70
70
+
- GfxFont *f = state->getFont();
71
71
+
+ const std::shared_ptr<GfxFont> f = state->getFont();
72
72
+
const char *p = s->c_str();
73
73
+
CharCode code;
74
74
+
int j = 0, m, n;
75
75
+
@@ -870,8 +875,8 @@ import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_
76
76
+
std::unique_ptr<PDFDoc> doc;
77
77
+
GooString *fileName = new GooString(filename);
78
78
+
// no passwords yet
79
79
+
- GooString *ownerPW = NULL;
80
80
+
- GooString *userPW = NULL;
81
81
+
+ const std::optional<GooString> ownerPW;
82
82
+
+ const std::optional<GooString> userPW;
83
83
+
gboolean ret = FALSE;
84
84
+
85
85
+
// without this we will get strange crashes (at least with /O2 build)
86
86
+
@@ -899,6 +904,7 @@ import_pdf(const gchar *filename, DiagramData *dia, DiaContext *ctx, void* user_
87
87
+
delete diaOut;
88
88
+
ret = TRUE;
89
89
+
}
90
90
+
+ doc.reset();
91
91
+
delete fileName;
92
92
+
93
93
+
return ret;
+1
-3
pkgs/top-level/all-packages.nix
···
28326
28326
28327
28327
dht = callPackage ../applications/networking/p2p/dht { };
28328
28328
28329
28329
-
dia = callPackage ../applications/graphics/dia {
28330
28330
-
inherit (gnome2) libart_lgpl libgnomeui;
28331
28331
-
};
28329
28329
+
dia = callPackage ../applications/graphics/dia { };
28332
28330
28333
28331
direwolf = callPackage ../applications/radio/direwolf {
28334
28332
hamlib = hamlib_4;