4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# CDDL HEADER START
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# The contents of this file are subject to the terms of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Common Development and Distribution License (the "License").
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You may not use this file except in compliance with the License.
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# or http://www.opensolaris.org/os/licensing.
83a28ca274521e15086fc39febde507bcc4e145eMark Andrews# See the License for the specific language governing permissions
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# and limitations under the License.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# When distributing Covered Code, include this CDDL HEADER in each
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# If applicable, add the following below this CDDL HEADER, with the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fields enclosed by brackets "[]" replaced with your own identifying
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# information: Portions Copyright [yyyy] [name of copyright owner]
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# CDDL HEADER END
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinBUILD_BITS=64
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# While the tree currently builds with Studio, we need to make sure it also
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# builds with gcc when submitting patches upstream, and having both sets of
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# options in the CFLAGS below makes it easy to switch when needed.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# COMPILER=gcc
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude ../../../make-rules/shared-macros.mk
194e2dfffa6a167b8eef0ad11864026b423a1c30Mark Andrews
194e2dfffa6a167b8eef0ad11864026b423a1c30Mark AndrewsCOMPONENT_NAME= xscreensaver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_VERSION= 5.34
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_PROJECT_URL= https://www.jwz.org/xscreensaver/
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark AndrewsCOMPONENT_ARCHIVE_HASH= \
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User sha256:6fff7ec4be743e5c042647ea9687dd0cdf48d1dd5e8e15098e5018bbd02e5e27
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox UserCOMPONENT_ARCHIVE_URL= https://www.jwz.org/xscreensaver/$(COMPONENT_ARCHIVE)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsCOMPONENT_BUGDB= gnome/screensaver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinTPNO= 26341
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinTEST_TARGET = $(NO_TESTS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Needs older version of libpng, no longer available in evaluation builds.
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafssoninclude $(WS_MAKE_RULES)/no-evaluation.mk
4b01d45a49f1c2cc4bddc9a1b4c78232867de134Andreas Gustafsson
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude $(WS_MAKE_RULES)/common.mk
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Enable additional warnings, since we've modified this code a lot
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark AndrewsCFLAGS.studio += -v
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCFLAGS.gcc += -Wall
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Additional optimization flags, to make the hacks show off the hardware
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# better and because for just a screensaver display we can get away with
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# using optimizations that may change strict correctness of floating point ops.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCFLAGS.studio += -fsimple=2 -nofstore -xlibmil -xprefetch
821350367e2c7313c02eb275e8e05d5193b47cfdJeremy C. ReedCFLAGS.gcc += -funsafe-math-optimizations
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Fix 64-bit linking; compiler is used for the linking.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLDFLAGS += $(CC_BITS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Regenerate configure after patches modify configure.in; the automake -af
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# forces the update of the standard automake files that autoreconf will not
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# update because Makefile.am does not exist. This is needed to ensure we have
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# a recent version of config.guess, etc. used for configure; the | true is
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews# because automake will exit with an error because Makefile.am does not exist,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# but it will update the required files.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv; automake -af | true)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Need to pick up the GNU version of xgettext.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinPATH=$(GNUBIN):$(USRBINDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Libraries & programs to depend on
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-gl=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-gtk=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-jpeg=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --without-motif
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-pixbuf=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-xft=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += PTHREAD_CFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += PTHREAD_LIBS="-lc"
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += PERL=$(PERL)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += INTLTOOL_PERL=$(PERL)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# X extensions to support
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-dpms-ext
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-randr-ext
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-xinerama-ext
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-xinput-ext # required for accessibility
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Support locking the screen by normal users and by root
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --enable-locking
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --enable-root-passwd
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# and allow user switching from the lock screen with gdmflexiserver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-login-manager
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Use only PAM, not direct /etc/shadow or kerberos access
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-pam=$(USRDIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --without-shadow
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --without-kerberos
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Paths to install to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinAPP_DEFAULTS_DIR = $(CONFIGURE_PREFIX)/share/X11/app-defaults
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinXSS_LIBDIR = $(CONFIGURE_PREFIX)/lib/xscreensaver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --libexecdir=$(XSS_LIBDIR)/bin
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-hackdir=$(XSS_LIBDIR)/hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-configdir=$(XSS_LIBDIR)/config/control-center-2.0
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-x-app-defaults=$(APP_DEFAULTS_DIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Data sources for images & text in hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-image-directory=$(USRSHAREDIR)/backgrounds
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-text-file=/etc/motd
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Do not install setuid hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --without-setuid-hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# The potfiles.in updates don't work unless source is cloned to build dir
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCOMPONENT_PRE_CONFIGURE_ACTION += ($(CLONEY) $(SOURCE_DIR) $(@D));
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews# Update potfiles.in to pick up our added sources like lock-Gtk.c
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# The "-o Makefile" & touch stamp-it is needed to avoid infinite looping.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_POST_CONFIGURE_ACTION += ( \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein cd $(@D)/po ; \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(MAKE) -o Makefile generate_potfiles_in ; \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(MAKE) -o Makefile POTFILES ; \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(MAKE) -o Makefile xscreensaver.pot ; \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein touch stamp-it )
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Recognizing DESTDIR as most autotools packages do would be too easy,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# so xscreensaver makes us override install_prefix instead for the same effect.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCOMPONENT_INSTALL_ARGS += install_prefix=$(PROTO_DIR)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Remove hacks we've chosen not to ship at all for various reasons
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREMOVED_HACKS="extrusion flyingtoasters ljlatest sonar webcollage"
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_POST_INSTALL_ACTION += ( \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinfor h in $(REMOVED_HACKS) ; do \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein rm -f $(PROTO_DIR)$(XSS_LIBDIR)/hacks/$${h} \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(PROTO_DIR)$(CONFIGURE_MANDIR)/man6/$${h}.6 \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(PROTO_DIR)$(XSS_LIBDIR)/config/control-center-2.0/$${h}.xml ;\
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeindone ; \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinrm -f $(PROTO_DIR)$(XSS_LIBDIR)/hacks/webcollage-helper );
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Adjust '#!/usr/bin/perl'
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinPERL_SCRIPTS= \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(PROTOUSRBINDIR)/xscreensaver-getimage-file \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(PROTOUSRBINDIR)/xscreensaver-getimage-video \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(PROTOUSRBINDIR)/xscreensaver-text
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += gnome/config/gconf
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += image/library/libjpeg
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/atk
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/gdk-pixbuf
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/gtk2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/libglade
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/pango
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/glib2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/libxml2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/perl-5/xml-parser
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += $(PERL_PKG)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += system/library/math
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libx11
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxext
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxft
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxi
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxinerama
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntREQUIRED_PACKAGES += x11/library/libxmu
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntREQUIRED_PACKAGES += x11/library/libxrandr
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark AndrewsREQUIRED_PACKAGES += x11/library/libxxf86misc
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxxf86vm
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/mesa
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/toolkit/libxt
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein