Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add jpeg #355

Closed
wants to merge 13 commits into from
48 changes: 48 additions & 0 deletions recipes/jpeg/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--- CMakeLists.txt 1970-01-01 10:00:00.000000000 +1000
+++ CMakeLists.txt 2016-04-15 14:26:56.952441300 +1000
@@ -0,0 +1,45 @@
+# Helper cmake for Windows
+# the default libjpeg build for Windows (see makefile.vc)
+# only builds a static library. Because the jpeg functions
+# aren't marked with __declspec(export) it is easiest
+# to use cmake and set the WINDOWS_EXPORT_ALL_SYMBOLS property
+# to create a DLL with all symbols exported and a implib (.lib)
+# that can be linked against.
+
+cmake_minimum_required (VERSION 3.4)
+project (JPEG)
+
+set(JPEG_SRC jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c
+ jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c
+ jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c
+ jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c
+ jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c
+ jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c
+ jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c
+ jquant2.c jutils.c jmemmgr.c jmemansi.c)
+add_library (libjpeg SHARED ${JPEG_SRC})
+
+target_include_directories (libjpeg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+set_target_properties(libjpeg PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
+add_executable (cjpeg cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c rdswitch.c cdjpeg.c)
+target_link_libraries (cjpeg libjpeg)
+add_executable (djpeg djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c rdcolmap.c cdjpeg.c)
+target_link_libraries (djpeg libjpeg)
+add_executable (jpegtran jpegtran.c rdswitch.c cdjpeg.c transupp.c)
+target_link_libraries (jpegtran libjpeg)
+add_executable (rdjpgcom rdjpgcom.c)
+target_link_libraries (rdjpgcom libjpeg)
+add_executable (wrjpgcom wrjpgcom.c)
+target_link_libraries (wrjpgcom libjpeg)
+
+add_library(jpeg STATIC ${JPEG_SRC})
+
+install(TARGETS libjpeg cjpeg djpeg jpegtran rdjpgcom wrjpgcom jpeg
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(FILES jpeglib.h jconfig.h jmorecfg.h jerror.h jpegint.h DESTINATION include)
+
14 changes: 14 additions & 0 deletions recipes/jpeg/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
REM Configure step
copy jconfig.vc jconfig.h
if errorlevel 1 exit 1

REM Build step
cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -D CMAKE_BUILD_TYPE=Release .
if errorlevel 1 exit 1

nmake
if errorlevel 1 exit 1

REM Install step
nmake install
if errorlevel 1 exit 1
8 changes: 8 additions & 0 deletions recipes/jpeg/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

Copy link
Member

@jakirkham jakirkham Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add #!/bin/bash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

./configure --prefix=$PREFIX \
--enable-shared=yes \
--enable-static=yes
make
make check
make install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make check?

48 changes: 48 additions & 0 deletions recipes/jpeg/licence.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.

This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.

Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.

These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.

Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".

We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.


The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
but is also freely distributable.

The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
support has been removed altogether, and the GIF writer has been simplified
to produce "uncompressed GIFs". This technique does not use the LZW
algorithm; the resulting GIF files are larger than usual, but are readable
by all standard GIF decoders.
41 changes: 41 additions & 0 deletions recipes/jpeg/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% set version = "9b" %}

package:
name: jpeg
version: {{ version }}

source:
fn: jpegsrc.v9b.tar.gz
url: http://www.ijg.org/files/jpegsrc.v{{ version }}.tar.gz
md5: 6a9996ce116ec5c52b4870dbcd6d3ddb
patches:
- CMakeLists.txt.patch # [win]

build:
number: 0
features:
- vc9 # [win and py27]
- vc10 # [win and py34]
- vc14 # [win and py35]

requirements:
build:
- python # [win]
- cmake # [win]

test:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the cross post, I don't think you need Python for building, but for testing - and you probably need to add a Jinja template to make sure the correct Python is chosen. This should fix the Windows errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I think I've got it working under Windows. Which is the Jinja template? appveyor seems to be running all the various versions of Python.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Jinja template is here. That should get the builds working. That will fix the fact that only Python 2.7 builds seems to work.

requires:
- python {{ environ['PY_VER'] + '*' }} # [win]
files:
- testorig.jpg
commands:
- djpeg -dct int -ppm -outfile testout.ppm testorig.jpg

about:
home: http://www.ijg.org/
license: Custom free software license
summary: read/write jpeg COM, EXIF, IPTC medata

extra:
recipe-maintainers:
- gillins
Binary file added recipes/jpeg/testorig.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.