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

Upgrade to FreeType 2.9.1 #27169

Closed
slel opened this issue Jan 29, 2019 · 33 comments
Closed

Upgrade to FreeType 2.9.1 #27169

slel opened this issue Jan 29, 2019 · 33 comments

Comments

@slel
Copy link
Member

slel commented Jan 29, 2019

This ticket is to upgrade to FreeType 2.9.1.

Note that downloading from that url works in a browser but not with
curl -O $URL which results in a zero byte file. Some redirection must be going on.

Our last upgrade was to FreeType 2.8.1 in #24240
(merged in SageMath 8.2.beta0).

This might help with #27163, see comment 27 there.

CC: @antonio-rojas @EmmanuelCharpentier @dimpase @embray @kiwifb @timokau @infinity0 @novoselt @slel @tobihan

Component: packages: standard

Keywords: upgrade, freetype

Author: Samuel Lelièvre, Dima Pasechnik

Branch/Commit: 4c0c338

Reviewer: François Bissey, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/27169

@slel slel added this to the sage-8.7 milestone Jan 29, 2019
@slel
Copy link
Member Author

slel commented Jan 29, 2019

Branch: u/slelievre/t/27169

@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Jan 29, 2019

comment:2

To upgrade, I downloaded the new tarball to upstream and then ran

sage --package update freetype 2.9.1

New commits:

a1dd17fUpgrade to FreeType 2.9.1

@slel
Copy link
Member Author

slel commented Jan 29, 2019

Commit: a1dd17f

@slel slel changed the title Upgrade to Freetype 2.9.1 Upgrade to FreeType 2.9.1 Jan 29, 2019
@slel
Copy link
Member Author

slel commented Jan 29, 2019

comment:3

The spkg-install has something about harfbuzz.

Someone knowledgeable should check if that is still needed.

@slel
Copy link
Member Author

slel commented Jan 29, 2019

comment:4

According to FreeType documentation,

FreeType is released under two open-source licenses:
our own BSD-like FreeType License and the GNU Public
License, Version 2. It can thus be used by any kind
of projects, be they proprietary or not.

Not sure if this double licensing was already the case when
FreeType was first included as a standard package, and
whether we should update the SPKG.txt to mention that.

@kiwifb
Copy link
Member

kiwifb commented Jan 29, 2019

comment:5

Yes, I thought I did the harfbuzz thing 4afa106

That's from 2015, I am hoping it is fixed but I cannot dig into it right now.

For the license I think we should update SPKG.txt as this is relevant for redistribution.

@kiwifb
Copy link
Member

kiwifb commented Jan 29, 2019

comment:6

There is a mirror of freetype on github so I could check. And the answer is yes. harfbuzz minimal version detection is now done. So it is fixed.

@dimpase
Copy link
Member

dimpase commented Jan 29, 2019

comment:7

Something is not right - check that one gets freetype-config script installed to SAGE_LOCAL/bin. This is needed for other libs using freetype, and seems to be broken by this update.

@slel
Copy link
Member Author

slel commented Jan 29, 2019

comment:8

Thanks François for mentioning that the FreeType code repo is mirrored
on GitHub; the main mirror and one such mirror are at:

The FreeType README
suggests:

Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION.

Read the files docs/INSTALL for installation instructions; see the file
docs/LICENSE.TXT for the available licenses.

The FreeType 2 API reference is located in docs/reference; use the file
ft2-toc.html as the top entry point. Additional documentation is available
as a separate package from our sites. Go to

and download one of the following files.

  • freetype-doc-2.9.1.tar.bz2
  • freetype-doc-2.9.1.tar.gz
  • ftdoc291.zip

To view the documentation online, go to

According to the
FreeType CHANGES file
(also mirrored on GitHub):

  • Use of the freetype-config script to get compilation and linking
    options is deprecated since it doesn't support cross-compiling, among
    other deficiencies. Instead, you should use the pkg-config interface.

    The configure script no longer installs freetype-config by
    default. For backwards compatibility, a new configure option
    --enable-freetype-config is provided that reverts this decision.

It might be worth going through the other changes listed there.

I feel a little bit out of my depth here, if someone wants to take over.

@dimpase
Copy link
Member

dimpase commented Jan 29, 2019

comment:9

I've got past this issue by

diff --git a/build/pkgs/freetype/spkg-install b/build/pkgs/freetype/spkg-install
index 49450d4944..b2713060ac 100644
--- a/build/pkgs/freetype/spkg-install
+++ b/build/pkgs/freetype/spkg-install
@@ -1,7 +1,7 @@
 cd src
 
 # Disabling harfbuzz until upstream properly check for suitable version
-GNUMAKE=${MAKE} sdh_configure --with-harfbuzz=no
+GNUMAKE=${MAKE} sdh_configure --enable-freetype-config
 sdh_make
 sdh_make_install

(no need to worry about harfbuzz any more.)

I think the rest of updates are enhancements, we don't need to worry about them.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2019

Changed commit from a1dd17f to 5813943

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

5813943Add description + url + double license info in freetype/SPKG.txt

@slel
Copy link
Member Author

slel commented Jan 29, 2019

Author: Samuel Lelièvre, Dima Pasechnik

@slel
Copy link
Member Author

slel commented Jan 29, 2019

comment:11

I edited SPKG.txt. Dima, would you push your change to spkg-install and set to needs_review?


New commits:

5813943Add description + url + double license info in freetype/SPKG.txt

@dimpase
Copy link
Member

dimpase commented Jan 29, 2019

comment:12

I can't push to your personal branch. As this is the only difference so far, and hopefully stays this way, I'd rather let you add this change yourself.

@dimpase
Copy link
Member

dimpase commented Jan 29, 2019

comment:13

OK, this also appears to fix #27163

Subject to adding patch in comment 9, positive review.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 30, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

4c0c338Enable freetype-config and no longer disable harfbuzz

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 30, 2019

Changed commit from 5813943 to 4c0c338

@slel
Copy link
Member Author

slel commented Jan 30, 2019

comment:15

Should have used a public branch, sorry. Added your change now.

@slel
Copy link
Member Author

slel commented Jan 30, 2019

Reviewer: François Bissey, Dima Pasechnik

@slel
Copy link
Member Author

slel commented Jan 30, 2019

comment:16

Cc-ing Andrey Novoseltsev in case this might impact SageCell.

@kiwifb
Copy link
Member

kiwifb commented Jan 30, 2019

comment:17

Looks good to me. Let's see if Andrey has something to say before putting it to positive review.

@novoselt
Copy link
Member

comment:18

I hope that SageMathCell will not be affected, so please go ahead!

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Jan 30, 2019

comment:21

On Debian testing, neither develop+#27169 nor develop+#25674+#27169 give a fincyional results. In both cases :

> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua 
      FALSE       FALSE       FALSE        TRUE       FALSE       FALSE 
   http/ftp     sockets      libxml        fifo      cledit       iconv 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
        NLS     profmem       cairo         ICU long.double     libcurl 
       TRUE       FALSE       FALSE        TRUE        TRUE        TRUE 
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
  impossible de charger l'objet partagé '/usr/local/sage-8/local/lib/R//modules//R_X11.so':
  /usr/lib/x86_64-linux-gnu/libcairo.so.2: undefined symbol: FT_Done_MM_Var

and

> install.packages("Cairo")
--- SVP sélectionner un miroir CRAN pour cette session ---
Secure CRAN mirrors 

 1: 0-Cloud [https]                   2: Algeria [https]                
 3: Australia (Canberra) [https]      4: Australia (Melbourne 1) [https]
 5: Australia (Melbourne 2) [https]   6: Australia (Perth) [https]      
 7: Austria [https]                   8: Belgium (Ghent) [https]        
 9: Brazil (PR) [https]              10: Brazil (RJ) [https]            
11: Brazil (SP 1) [https]            12: Brazil (SP 2) [https]          
13: Bulgaria [https]                 14: Chile 1 [https]                
15: Chile 2 [https]                  16: China (Hong Kong) [https]      
17: China (Guangzhou) [https]        18: China (Lanzhou) [https]        
19: China (Shanghai 1) [https]       20: China (Shanghai 2) [https]     
21: Colombia (Cali) [https]          22: Czech Republic [https]         
23: Denmark [https]                  24: East Asia [https]              
25: Ecuador (Cuenca) [https]         26: Ecuador (Quito) [https]        
27: Estonia [https]                  28: France (Lyon 1) [https]        
29: France (Lyon 2) [https]          30: France (Marseille) [https]     
31: France (Montpellier) [https]     32: France (Paris 2) [https]       
33: Germany (Erlangen) [https]       34: Germany (Göttingen) [https]    
35: Germany (Münster) [https]        36: Greece [https]                 
37: Iceland [https]                  38: India [https]                  
39: Indonesia (Jakarta) [https]      40: Ireland [https]                
41: Italy (Padua) [https]            42: Japan (Tokyo) [https]          
43: Japan (Yonezawa) [https]         44: Korea (Busan) [https]          
45: Korea (Gyeongsan-si) [https]     46: Korea (Seoul 1) [https]        
47: Korea (Ulsan) [https]            48: Malaysia [https]               
49: Mexico (Mexico City) [https]     50: Norway [https]                 
51: Philippines [https]              52: Serbia [https]                 
53: Spain (A Coruña) [https]         54: Spain (Madrid) [https]         
55: Sweden [https]                   56: Switzerland [https]            
57: Turkey (Denizli) [https]         58: Turkey (Mersin) [https]        
59: UK (Bristol) [https]             60: UK (London 1) [https]          
61: USA (CA 1) [https]               62: USA (IA) [https]               
63: USA (KS) [https]                 64: USA (MI 1) [https]             
65: USA (OR) [https]                 66: USA (TN) [https]               
67: USA (TX 1) [https]               68: Uruguay [https]                
69: (other mirrors)                  

Selection: 32
essai de l'URL 'https://cran.univ-paris1.fr/src/contrib/Cairo_1.5-9.tar.gz'
Content type 'application/x-gzip' length 86982 bytes (84 KB)
==================================================
downloaded 84 KB

* installing *source* package ‘Cairo’ ...
** package ‘Cairo’ correctement décompressé et sommes MD5 vérifiées
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/local/sage-8/local/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-I/usr/local/sage-8/local/include -I/usr/local/sage-8/local/include/freetype2 -I/usr/local/sage-8/local/include -I/usr/local/sage-8/local/include/libpng16 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/usr/local/sage-8/local/lib -lfreetype -lz -lpng16 -lz -lcairo -lXext -lXrender -lX11
checking for library containing deflate... no
checking whether Cairo programs can be compiled... configure: error: Cannot compile a simple Cairo program. See config.log for details.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/usr/local/sage-8/local/lib/R/library/Cairo’

Les packages source téléchargés sont dans
	‘/tmp/RtmpDoPTkq/downloaded_packages’
Warning message:
In install.packages("Cairo") :
  l'installation du package ‘Cairo’ a eu un statut de sortie non nul

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Jan 30, 2019

comment:22

Replying to @EmmanuelCharpentier:

Please forget that. Apparently, the tarbal download didn't work an I didn't see that. I'll have to retry.

My most sincere apologies...

[ Lots of bollocks : Snip... ]

@dimpase
Copy link
Member

dimpase commented Jan 30, 2019

comment:23

You can always check what version of freetype you have installed in Sage by calling, at sage -sh prompt, freetype-config --ftversion. E.g.

$ sage -sh
...
$ freetype-config  --ftversion
2.9.1

by the way, no need to post lists of CRAN mirrors---you probably also know
that

install.packages('Cairo', repos='https://cran.univ-paris1.fr')

would automatically get to the repo of your choice.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Jan 30, 2019

comment:24

After squelching my coroirate firewall's BS and correctly installing the source tarball, I now get graphical capabilities with both R 3.4.4 and R 3.5.3 ; in both cases, teh R Cairo package installs correctly.

ptestlong underway (with 3.5.2). That will take a bit of time...

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Jan 30, 2019

comment:25

Replying to @dimpase:

You can always check what version of freetype you have installed in Sage by calling, at sage -sh prompt, freetype-config --ftversion. E.g.

$ sage -sh
...
$ freetype-config  --ftversion
2.9.1

I didn't knew that. Thanks for the tip !

by the way, no need to post lists of CRAN mirrors

Indeed. I was typing too fast...

---you probably also know that

install.packages('Cairo', repos='https://cran.univ-paris1.fr')

would automatically get to the repo of your choice.

Indeed also. But the damn firewall tries to nanny us, which seriously interferes with the availability of a given site, changing with time... So I tend to systematically let R search for a suitable repository.

What troubles me more is that make didn't display any error when I recompiled without the proper freetype source tarball. It should have complained, no ?

@slel
Copy link
Member Author

slel commented Jan 30, 2019

comment:26

Forgot to warn that downloading from that url works in a browser but not with
curl -O $URL which results in a zero byte file. Some redirection must be going on.

@slel

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jan 30, 2019

comment:27

Replying to @EmmanuelCharpentier:

What troubles me more is that make didn't display any error when I recompiled without the proper freetype source tarball. It should have complained, no ?

Sage's dependencies resolution is far from ideal. The first thing I'd to to test a new package is to run ./sage -f <package_name> followed by make build.

@vbraun
Copy link
Member

vbraun commented Feb 4, 2019

Changed branch from u/slelievre/t/27169 to 4c0c338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants