1*1c25f252Sdamjan#************************************************************** 2*1c25f252Sdamjan# 3*1c25f252Sdamjan# Licensed to the Apache Software Foundation (ASF) under one 4*1c25f252Sdamjan# or more contributor license agreements. See the NOTICE file 5*1c25f252Sdamjan# distributed with this work for additional information 6*1c25f252Sdamjan# regarding copyright ownership. The ASF licenses this file 7*1c25f252Sdamjan# to you under the Apache License, Version 2.0 (the 8*1c25f252Sdamjan# "License"); you may not use this file except in compliance 9*1c25f252Sdamjan# with the License. You may obtain a copy of the License at 10*1c25f252Sdamjan# 11*1c25f252Sdamjan# http://www.apache.org/licenses/LICENSE-2.0 12*1c25f252Sdamjan# 13*1c25f252Sdamjan# Unless required by applicable law or agreed to in writing, 14*1c25f252Sdamjan# software distributed under the License is distributed on an 15*1c25f252Sdamjan# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1c25f252Sdamjan# KIND, either express or implied. See the License for the 17*1c25f252Sdamjan# specific language governing permissions and limitations 18*1c25f252Sdamjan# under the License. 19*1c25f252Sdamjan# 20*1c25f252Sdamjan#************************************************************** 21*1c25f252Sdamjan 22*1c25f252Sdamjaninclude $(SRCDIR)/python/pyversion.mk 23*1c25f252Sdamjan 24*1c25f252Sdamjan$(eval $(call gb_Package_Package,pyuno_zipcore,$(WORKDIR)/CustomTarget/pyuno/zipcore)) 25*1c25f252Sdamjan 26*1c25f252Sdamjan$(eval $(call gb_Package_add_file,pyuno_zipcore,bin/python-core-$(PYVERSION).zip,python-core-$(PYVERSION).zip)) 27*1c25f252Sdamjan 28*1c25f252Sdamjan 29*1c25f252Sdamjan 30*1c25f252Sdamjanifneq ($(GUI),UNX) 31*1c25f252Sdamjanifeq ($(COM),GCC) 32*1c25f252SdamjanPYTHONBINARY := $(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/bin/python.bin 33*1c25f252Sdamjanelse 34*1c25f252SdamjanPYTHONBINARY := $(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/bin/python$(gb_Executable_EXT) 35*1c25f252Sdamjanendif 36*1c25f252Sdamjanendif 37*1c25f252Sdamjan 38*1c25f252SdamjanPYTHON_CORE_FILES := $(PYTHONBINARY) \ 39*1c25f252Sdamjan $(foreach lib,$(shell find $(OUTDIR)/lib/python -type f | grep -v "\.pyc" | grep -v "\.py~" | grep -v .orig | grep -v _failed),$(subst $(OUTDIR)/lib/python,$(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/lib,$(lib))) \ 40*1c25f252Sdamjan $(foreach inc,$(shell find $(OUTDIR)/inc/python -type f | grep -v "\.h~" | grep -v _failed),$(subst $(OUTDIR)/inc/python,$(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/include/python$(PYMAJOR).$(PYMINOR),$(inc))) 41*1c25f252Sdamjan 42*1c25f252Sdamjan$(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION).zip : $(PYTHON_CORE_FILES) 43*1c25f252Sdamjan mkdir -p $(dir $@) && \ 44*1c25f252Sdamjan cd $(dir $@) && \ 45*1c25f252Sdamjan $(if $(filter-out MACOSX,$(OS)),$(if $(filter UNX,$(GUI)),find . -name "*$(gb_Library_PLAINEXT)" | xargs strip &&)) \ 46*1c25f252Sdamjan zip -r python-core-$(PYVERSION).zip python-core-$(PYVERSION) 47*1c25f252Sdamjan 48*1c25f252Sdamjanifneq ($(GUI),UNX) 49*1c25f252Sdamjan$(PYTHONBINARY) : $(OUTDIR)/bin/python$(gb_Executable_EXT) 50*1c25f252Sdamjan mkdir -p $(dir $@) && \ 51*1c25f252Sdamjan cp $< $@ 52*1c25f252Sdamjanendif 53*1c25f252Sdamjan 54*1c25f252Sdamjan$(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/lib/% : $(OUTDIR)/lib/python/% 55*1c25f252Sdamjan mkdir -p $(dir $@) && \ 56*1c25f252Sdamjan cp $< $@ 57*1c25f252Sdamjan 58*1c25f252Sdamjan$(WORKDIR)/CustomTarget/pyuno/zipcore/python-core-$(PYVERSION)/include/python$(PYMAJOR).$(PYMINOR)/% : $(OUTDIR)/inc/python/% 59*1c25f252Sdamjan mkdir -p $(dir $@) && \ 60*1c25f252Sdamjan cp $< $@ 61*1c25f252Sdamjan 62