Use system packaged unifont.
authorAnton Gladky <gladk@debian.org>
Mon, 15 Aug 2016 20:15:09 +0000 (22:15 +0200)
committerAnton Gladky <gladk@debian.org>
Mon, 15 Aug 2016 20:15:09 +0000 (22:15 +0200)
debian/control
debian/patches/20_use_system_unifont.patch [new file with mode: 0644]
debian/patches/series

index be09a2123954fca71fb9192611612489f13ae623..3ad677d678a708c31a2a0f52b396fadaeb6a7ded 100644 (file)
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: whitequark <whitequark@whitequark.org>
 Build-Depends: debhelper (>= 9), cmake, libpng-dev, zlib1g-dev, libjson-c-dev,
     libfontconfig1-dev, libgtkmm-2.4-dev, libpangomm-1.4-dev,
-    libgl-dev, libglu-dev, libglew-dev
+    libgl-dev, libglu-dev, libglew-dev, unifont
 Standards-Version: 3.9.5
 Homepage: http://solvespace.com
 Vcs-Git: git://github.com/whitequark/solvespace
diff --git a/debian/patches/20_use_system_unifont.patch b/debian/patches/20_use_system_unifont.patch
new file mode 100644 (file)
index 0000000..2ece363
--- /dev/null
@@ -0,0 +1,56 @@
+Description: Use system packaged unifont
+Author: Anton Gladky <gladk@debian.org>
+Last-Update: 2016-08-15
+
+Index: solvespace/src/CMakeLists.txt
+===================================================================
+--- solvespace.orig/src/CMakeLists.txt
++++ solvespace/src/CMakeLists.txt
+@@ -101,10 +101,10 @@ add_custom_command(
+     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/bitmapfont.table.h
+     COMMAND $<TARGET_FILE:unifont2c>
+             ${CMAKE_CURRENT_BINARY_DIR}/generated/bitmapfont.table.h
+-            ${CMAKE_CURRENT_SOURCE_DIR}/fonts/unifont-8.0.01.hex.gz
++            /usr/share/unifont/unifont.hex
+             ${chars}
+     DEPENDS unifont2c
+-            ${CMAKE_CURRENT_SOURCE_DIR}/fonts/unifont-8.0.01.hex.gz
++            /usr/share/unifont/unifont.hex
+             ${chars}
+     VERBATIM)
+Index: solvespace/tools/unifont2c.cpp
+===================================================================
+--- solvespace.orig/tools/unifont2c.cpp
++++ solvespace/tools/unifont2c.cpp
+@@ -118,17 +118,17 @@ int main(int argc, char** argv) {
+         properties[codepoint].exists = true;
+     }
+-    gzFile unifont = gzopen(argv[2], "rb");
++    FILE *unifont = fopen(argv[2], "rb");
+     if(!unifont)
+         die("unifont fopen failed");
+     while(1) {
+         char buf[100];
+-        if(!gzgets(unifont, buf, sizeof(buf))){
+-            if(gzeof(unifont)) {
++        if(!fgets(buf, sizeof(buf), unifont)){
++            if(feof(unifont)) {
+                 break;
+             } else {
+-                die("unifont gzgets failed");
++                die("unifont gets failed");
+             }
+         }
+@@ -164,7 +164,7 @@ int main(int argc, char** argv) {
+         properties[codepoint].isWide = isWide;
+     }
+-    gzclose(unifont);
++    fclose(unifont);
+     FILE *source = fopen(argv[1], "wt");
+     if(!source)
index 1f205726b52aa6392aae106dcc4fd0c476c1cade..ebc2025ab4e784d6a49844404685b027170f7d09 100644 (file)
@@ -1 +1,2 @@
 01_RemoveGitHash.patch
+20_use_system_unifont.patch