Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Commit

Permalink
Added jbig
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarteberg committed Nov 6, 2015
1 parent 68be9e9 commit 5609b2a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jbig/Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- Makefile 2014-03-27 14:47:15.000000000 -0400
+++ Makefile 2015-11-06 14:14:48.000000000 -0500
@@ -4,7 +4,7 @@
CC = gcc

# Options for the compiler: A high optimization level is suggested
-CFLAGS = -O2 -W -Wno-unused-result
+CFLAGS = -O2 -W -fPIC

This comment has been minimized.

Copy link
@jakirkham

jakirkham Apr 16, 2016

Contributor

Why was this patch needed? Did setting CFLAGS not work?

This comment has been minimized.

Copy link
@jakirkham

jakirkham Apr 16, 2016

Contributor

We're adding this to conda-forge and the question came up here.

This comment has been minimized.

Copy link
@stuarteberg

stuarteberg Apr 17, 2016

Author Contributor

Why was this patch needed? Did setting CFLAGS not work?

I'm not a make expert, but IIUC it works like this:

If a Makefile assigns to a variable as done here, then the old value (from the environment or wherever) is always lost. If the author of this Makefile wanted to respect the user's environment, he would have to use the ?= assignment operator, which only executes the assignment if the variable is undefined:

CFLAGS ?= -O2 -W -Wno-unused-result

...but since they didn't do that, I needed a patch.

# CFLAGS = -O -g -W -Wall -Wno-unused-result -ansi -pedantic # -DDEBUG

export CC CFLAGS
12 changes: 12 additions & 0 deletions jbig/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Patch (support old gcc)
sed -i.bak 's/-Wno-unused-result//g' Makefile

# Build
make lib

# Install
mkdir -p "${PREFIX}/lib" "${PREFIX}/include"
cp libjbig/*.a "${PREFIX}/lib"
cp libjbig/*.h "${PREFIX}/include"
16 changes: 16 additions & 0 deletions jbig/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package:
name: jbig
version: "2.1"

source:
fn: jbigkit-2.1.tar.gz
url: https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz
md5: ebcf09bed9f14d7fa188d3bd57349522

patches:
- Makefile.patch # Remove -Wno-unused-result (for compatibility with old gcc),
# and add -fPIC (to allow shared libraries to use this build).

about:
home: https://www.cl.cam.ac.uk/~mgk25/jbigkit
license: GPL-2

0 comments on commit 5609b2a

Please sign in to comment.