Skip to content

Commit

Permalink
Update libpng to use pristine upstream archive (#14300)
Browse files Browse the repository at this point in the history
The config file was generated by emconfigure.

Use mirror of archive on google storage to avoid depending
on sourceforge download links (which we have had issues
with in the past).
  • Loading branch information
HCLJason committed May 26, 2021
1 parent 42f99e2 commit b15ca40
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/third_party/libpng/pngtest.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/* pngtest.c - a simple test program to test libpng
*
* Last changed in libpng 1.6.17 [March 26, 2015]
* Last changed in libpng 1.6.37 [March 26, 2015]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
Expand Down Expand Up @@ -2028,4 +2028,4 @@ main(void)
#endif

/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_17 Your_png_h_is_not_version_1_6_17;
typedef png_libpng_version_1_6_37 Your_png_h_is_not_version_1_6_37;
32 changes: 19 additions & 13 deletions tools/ports/libpng.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import shutil
import logging

TAG = 'version_1'
HASH = 'a19ede8a4339f2745a490c22f3893899e1a5eae9d2b270e49d88d3a85239fbbaa26c9a352d0e6fb8bb69b4f45bd00c1ae9eff29b60cf03e79c5df45a4409992f'
TAG = '1.6.37'
HASH = '2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338'

deps = ['zlib']

Expand All @@ -18,7 +18,8 @@ def needed(settings):


def get(ports, settings, shared):
ports.fetch_project('libpng', 'https://github.com/emscripten-ports/libpng/archive/' + TAG + '.zip', 'libpng-' + TAG, sha512hash=HASH)
# This is an emscripten-hosted mirror of the libpng repo from Sourceforge.
ports.fetch_project('libpng', 'https://storage.googleapis.com/webassembly/emscripten-ports/libpng-' + TAG + '.tar.gz', 'libpng-' + TAG, sha512hash=HASH)

def create(final):
logging.info('building port: libpng')
Expand Down Expand Up @@ -53,13 +54,12 @@ def show():
return 'libpng (USE_LIBPNG=1; zlib license)'


pnglibconf_h = r'''/* libpng 1.6.17 STANDARD API DEFINITION */
pnglibconf_h = r'''/* pnglibconf.h - library build configuration */
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.37 */
/* Libpng version 1.6.17 - March 26, 2015 */
/* Copyright (c) 1998-2014 Glenn Randers-Pehrson */
/* Copyright (c) 2018-2019 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
/* For conditions of distribution and use, see the disclaimer */
Expand Down Expand Up @@ -99,6 +99,8 @@ def show():
#define PNG_IO_STATE_SUPPORTED
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_16BIT_SUPPORTED
#define PNG_READ_ALPHA_MODE_SUPPORTED
Expand Down Expand Up @@ -137,6 +139,7 @@ def show():
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_bKGD_SUPPORTED
#define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_eXIf_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
Expand All @@ -156,8 +159,6 @@ def show():
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_SETJMP_SUPPORTED
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
#define PNG_SET_OPTION_SUPPORTED
#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
Expand All @@ -166,6 +167,7 @@ def show():
#define PNG_SIMPLIFIED_READ_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
#define PNG_STDIO_SUPPORTED
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
Expand All @@ -177,7 +179,7 @@ def show():
#define PNG_USER_MEM_SUPPORTED
#define PNG_USER_TRANSFORM_INFO_SUPPORTED
#define PNG_USER_TRANSFORM_PTR_SUPPORTED
#define PNG_WARNINGS_SUPPORTED
/*#undef PNG_WARNINGS_SUPPORTED*/
#define PNG_WRITE_16BIT_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_BGR_SUPPORTED
Expand Down Expand Up @@ -207,6 +209,7 @@ def show():
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
#define PNG_WRITE_cHRM_SUPPORTED
#define PNG_WRITE_eXIf_SUPPORTED
#define PNG_WRITE_gAMA_SUPPORTED
#define PNG_WRITE_hIST_SUPPORTED
#define PNG_WRITE_iCCP_SUPPORTED
Expand All @@ -224,6 +227,7 @@ def show():
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_bKGD_SUPPORTED
#define PNG_cHRM_SUPPORTED
#define PNG_eXIf_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_hIST_SUPPORTED
#define PNG_iCCP_SUPPORTED
Expand All @@ -242,11 +246,14 @@ def show():
/* end of options */
/* settings */
#define PNG_API_RULE 0
#define PNG_COST_SHIFT 3
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_GAMMA_THRESHOLD_FIXED 5000
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
#define PNG_INFLATE_BUF_SIZE 1024
#define PNG_LINKAGE_API extern
#define PNG_LINKAGE_CALLBACK extern
#define PNG_LINKAGE_DATA extern
#define PNG_LINKAGE_FUNCTION extern
#define PNG_MAX_GAMMA_8 11
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_QUANTIZE_GREEN_BITS 5
Expand All @@ -257,7 +264,6 @@ def show():
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
#define PNG_USER_HEIGHT_MAX 1000000
#define PNG_USER_WIDTH_MAX 1000000
#define PNG_WEIGHT_SHIFT 8
#define PNG_ZBUF_SIZE 8192
#define PNG_ZLIB_VERNUM 0 /* unknown */
#define PNG_Z_DEFAULT_COMPRESSION (-1)
Expand Down

0 comments on commit b15ca40

Please sign in to comment.