From d83e24a96b72fe9de4128314761962af270bd9f3 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 21 Oct 2014 12:07:45 -0500 Subject: [PATCH 01/34] Documentation for ofVideoGrabber's base classes. --- libs/openFrameworks/types/ofBaseTypes.h | 75 +++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/libs/openFrameworks/types/ofBaseTypes.h b/libs/openFrameworks/types/ofBaseTypes.h index b3f779b4698..eb168505678 100644 --- a/libs/openFrameworks/types/ofBaseTypes.h +++ b/libs/openFrameworks/types/ofBaseTypes.h @@ -76,7 +76,10 @@ class ofBaseDraws{ class ofBaseUpdates{ public: + /// \brief Destroy the ofBaseUpdates. virtual ~ofBaseUpdates(){} + + /// \brief Update the object's state. virtual void update()=0; }; @@ -107,6 +110,7 @@ class ofBaseHasTexturePlanes: public ofBaseHasTexture{ //---------------------------------------------------------- class ofAbstractHasPixels{ public: + /// \brief Destroy the ofAbstractHasPixels. virtual ~ofAbstractHasPixels(){} }; @@ -116,8 +120,15 @@ class ofAbstractHasPixels{ template class ofBaseHasPixels_: public ofAbstractHasPixels{ public: + /// \brief Destroy the ofAbstractHasPixels. virtual ~ofBaseHasPixels_(){} - virtual ofPixels_ & getPixels()=0; + + /// \brief Get a reference to the underlying ofPixels. + /// \returns a reference the underlying ofPixels. + virtual ofPixels_ & getPixels()=0; + + /// \brief Get a const reference to the underlying ofPixels. + /// \returns a const reference the underlying ofPixels. virtual const ofPixels_ & getPixels() const=0; }; @@ -192,12 +203,24 @@ class ofBaseSoundOutput{ //---------------------------------------------------------- class ofBaseVideo: virtual public ofBaseHasPixels, public ofBaseUpdates{ public: + /// \brief Destroy the ofBaseVideo. virtual ~ofBaseVideo(){} + + /// \returns true if the pixel data was updated since the last update(). virtual bool isFrameNew() const =0; + + /// \brief Close the video device. virtual void close()=0; + + /// \returns true if the video device is initialized. virtual bool isInitialized() const=0; + /// \brief Set the requested ofPixelFormat. + /// \param pixelFormat the requested ofPixelFormat. + /// \returns true if the format was successfully changed. virtual bool setPixelFormat(ofPixelFormat pixelFormat) = 0; + + /// \returns the current ofPixelFormat. virtual ofPixelFormat getPixelFormat() const = 0; }; @@ -216,22 +239,64 @@ class ofBaseVideoDraws: virtual public ofBaseVideo, public ofBaseDraws, public o class ofBaseVideoGrabber: virtual public ofBaseVideo{ public : + /// \brief Destroy the ofBaseVideoGrabber virtual ~ofBaseVideoGrabber(); //needs implementing + /// \brief Get a list of available video grabber devices. + /// \returns a std::vector of ofVideoDevice objects. virtual vector listDevices() const = 0; + + /// \brief Set up the grabber with the requested width and height. + /// + /// Some video grabbers may not take the requested width and height as + /// a hint and choose the closest dimensions to those requested. + /// Users can check the actual width and height by calling getWidth() and + /// getHeight() respectively after a successful setup. + /// + /// \param w the requested width. + /// \param h the requested height. + /// \returns true if the video grabber was set up successfully. virtual bool setup(int w, int h) = 0; - + + /// \brief Get the video grabber's height. + /// \returns the video grabbers height. virtual float getHeight() const = 0; + + /// \brief Get the video grabber's width. + /// \returns the video grabbers width. virtual float getWidth() const = 0; - // implement only if internal API can upload directly to texture + /// \brief Get the video grabber's internal ofTexture pointer if available. + /// + /// \note Subclasses should implement this method only if internal API can + /// upload video grabber pixels directly to an ofTexture. + /// + /// \returns the internal ofTexture pointer or NULL of not available. virtual ofTexture * getTexturePtr(){ return NULL; } - //should implement! + /// \brief Set the video grabber's hardware verbosity level. + /// \param bTalkToMe true if verbose grabber logging feedback is required. virtual void setVerbose(bool bTalkToMe); - virtual void setDeviceID(int _deviceID); + + /// \brief Set the video grabber's device ID. + /// + /// In most cases, a user can choose a specific grabber source by ID. This + /// device ID information should be available to the user via the + /// listDevices() method. + /// + /// \param deviceID The device ID provided by listDevices(). + virtual void setDeviceID(int deviceID); + + /// \brief Set the video grabber's desired frame rate. + /// + /// Many video grabbers support user-specified frame rates. This frame rate + /// should be considered a hint for the video grabber and is not guaranteed. + /// \param framerate the desired frame rate. virtual void setDesiredFrameRate(int framerate); + + /// \brief Request a native GUI for video grabber settings. + /// \note This feature may not be implemented by all video grabbers. virtual void videoSettings(); }; From 33ef1b2006fd0b11df63be32581e3c1250c9ea7f Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 21 Oct 2014 12:41:26 -0500 Subject: [PATCH 02/34] Additional base class documentation. --- libs/openFrameworks/types/ofBaseTypes.h | 213 ++++++++++++++++-------- 1 file changed, 143 insertions(+), 70 deletions(-) diff --git a/libs/openFrameworks/types/ofBaseTypes.h b/libs/openFrameworks/types/ofBaseTypes.h index eb168505678..0b0ddc9910c 100644 --- a/libs/openFrameworks/types/ofBaseTypes.h +++ b/libs/openFrameworks/types/ofBaseTypes.h @@ -70,10 +70,7 @@ class ofBaseDraws{ }; -//---------------------------------------------------------- -// ofBaseUpdates -//---------------------------------------------------------- - +/// \brief An abstract class representing an object can be updated. class ofBaseUpdates{ public: /// \brief Destroy the ofBaseUpdates. @@ -84,39 +81,75 @@ class ofBaseUpdates{ }; -//---------------------------------------------------------- -// ofBaseHasTexture -//---------------------------------------------------------- class ofTexture; + +/// \brief An abstract class representing an object that can has an ofTexture. class ofBaseHasTexture{ public: + /// \brief Destroy the ofBaseHasTexture. virtual ~ofBaseHasTexture(){} + + /// \returns a reference the the ofTexture. virtual ofTexture & getTexture()=0; + + /// \returns a const reference the the ofTexture. virtual const ofTexture & getTexture() const=0; + + /// \brief Enable or disable internal ofTexture use. + /// \param bUseTex true if an ofTexture should be used. virtual void setUseTexture(bool bUseTex)=0; + + /// \returns true if an internal ofTexture is being used. virtual bool isUsingTexture() const=0; }; + +/// \brief An abstract class representing an object that ofTexture planes. class ofBaseHasTexturePlanes: public ofBaseHasTexture{ public: + /// \brief Destroy the ofBaseHasTexturePlanes. virtual ~ofBaseHasTexturePlanes(){} + + /// \returns a reference to a std::vector containing the ofTexture planes. virtual vector & getTexturePlanes()=0; + + /// \returns a const reference to a std::vector containing the ofTexture planes. virtual const vector & getTexturePlanes() const=0; }; -//---------------------------------------------------------- -// ofAbstractHasPixels -//---------------------------------------------------------- + +/// \brief An abstract class representing an object that has pixels. +/// +/// This empty class primarily exists to allow templated subclasses of different +/// types to be stored as raw or shared pointers in collections such as +/// std::vector. +/// +/// Example: +/// \code{.cpp} +/// +/// std::vector pixelProviders; +/// +/// ofPixels pixels; +/// ofFloatPixels floatPixels; +/// ofShortPixels shortPixels; +/// +/// // ... +/// +/// pixelProviders.push_back(&pixels); +/// pixelProviders.push_back(&floatPixels); +/// pixelProviders.push_back(&shortPixels); +/// +/// \endcode class ofAbstractHasPixels{ public: /// \brief Destroy the ofAbstractHasPixels. virtual ~ofAbstractHasPixels(){} }; -//---------------------------------------------------------- -// ofBaseHasPixels -//---------------------------------------------------------- + +/// \brief A base class represeting an object that has pixels. +/// \tparam T The pixel data type. template class ofBaseHasPixels_: public ofAbstractHasPixels{ public: @@ -132,87 +165,128 @@ class ofBaseHasPixels_: public ofAbstractHasPixels{ virtual const ofPixels_ & getPixels() const=0; }; +/// \brief A typedef for an unsigned char ofBaseHasPixels_. typedef ofBaseHasPixels_ ofBaseHasPixels; + +/// \brief A typedef for an float ofBaseHasPixels_. typedef ofBaseHasPixels_ ofBaseHasFloatPixels; + +/// \brief A typedef for an unsigned short ofBaseHasPixels_. typedef ofBaseHasPixels_ ofBaseHasShortPixels; -//---------------------------------------------------------- -// ofAbstractImage -> to be able to put different types of images in vectors... -//---------------------------------------------------------- + +/// \brief An abstract class representing an image. +/// +/// This empty class primarily exists to allow templated subclasses of different +/// types to be stored as raw or shared pointers in collections such as +/// std::vector. +/// +/// Example: +/// \code{.cpp} +/// +/// std::vector imageProviders; +/// +/// ofImage image; +/// ofFloatImage floatImage; +/// ofShortImage shortImage; +/// +/// // ... +/// +/// imageProviders(&image); +/// imageProviders(&floatImage); +/// imageProviders(&shortImage); +/// +/// \endcode class ofAbstractImage: public ofBaseDraws, public ofBaseHasTexture{ public: + /// \brief Destroy the ofAbstractImage. virtual ~ofAbstractImage(){} }; -//---------------------------------------------------------- -// ofBaseImage -//---------------------------------------------------------- +/// \brief A base class represeting an image. +/// \tparam T The pixel data type. template class ofBaseImage_: public ofAbstractImage, virtual public ofBaseHasPixels_{ public: + /// \brief Destroy the ofBaseImage_. virtual ~ofBaseImage_(){}; }; + +/// \brief A typedef for an unsigned char ofBaseImage_. typedef ofBaseImage_ ofBaseImage; + +/// \brief A typedef for an float ofBaseImage_. typedef ofBaseImage_ ofBaseFloatImage; + +/// \brief A typedef for an unsigned short ofBaseImage_. typedef ofBaseImage_ ofBaseShortImage; -//---------------------------------------------------------- -// ofBaseHasSoundStream -//---------------------------------------------------------- -class ofBaseSoundInput{ - public: - virtual ~ofBaseSoundInput() {}; - - virtual void audioIn( float * input, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ - audioIn(input, bufferSize, nChannels); - } - virtual void audioIn( float * input, int bufferSize, int nChannels ){ - audioReceived(input, bufferSize, nChannels); - } +/// \brief A base class representing a sound input stream. +class ofBaseSoundInput{ +public: + /// \brief Destroy the ofBaseSoundInput. + virtual ~ofBaseSoundInput() {}; - virtual void audioReceived( float * input, int bufferSize, int nChannels ){} -}; + /// \todo + virtual void audioIn( float * input, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ + audioIn(input, bufferSize, nChannels); + } -//---------------------------------------------------------- -// ofBaseHasSoundStream -//---------------------------------------------------------- -class ofBaseSoundOutput{ + /// \todo + virtual void audioIn( float * input, int bufferSize, int nChannels ){ + audioReceived(input, bufferSize, nChannels); + } - public: - virtual ~ofBaseSoundOutput() {}; - - virtual void audioOut( float * output, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ - audioOut(output, bufferSize, nChannels); - } + /// \todo + virtual void audioReceived( float * input, int bufferSize, int nChannels ){} +}; - virtual void audioOut( float * output, int bufferSize, int nChannels ){ - audioRequested(output, bufferSize, nChannels); - } - //legacy - virtual void audioRequested( float * output, int bufferSize, int nChannels ){ - } +/// \brief A base class representing a sound output stream. +class ofBaseSoundOutput{ +public: + /// \brief Destroy the ofBaseSoundOutput. + virtual ~ofBaseSoundOutput() {}; + + /// \todo + virtual void audioOut( float * output, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ + audioOut(output, bufferSize, nChannels); + } + + /// \todo + virtual void audioOut( float * output, int bufferSize, int nChannels ){ + audioRequested(output, bufferSize, nChannels); + } + + /// \todo + /// \note This is a legacy method. + virtual void audioRequested( float * output, int bufferSize, int nChannels ){ + } }; -//---------------------------------------------------------- -// ofBaseVideo -//---------------------------------------------------------- +/// \brief A base class representing a video source. class ofBaseVideo: virtual public ofBaseHasPixels, public ofBaseUpdates{ public: /// \brief Destroy the ofBaseVideo. virtual ~ofBaseVideo(){} - /// \returns true if the pixel data was updated since the last update(). + /// \returns true if the pixel data was updated since the last call to update(). virtual bool isFrameNew() const =0; - /// \brief Close the video device. + /// \brief Close the video source. virtual void close()=0; - /// \returns true if the video device is initialized. + /// \brief Determine if the video source is initialized. + /// + /// Video sources such as cameras are often initialized with a + /// setup() method. Video sources such as movie players are often + /// initialized with a load() method. + /// + /// \returns true if the video source is initialized. virtual bool isInitialized() const=0; /// \brief Set the requested ofPixelFormat. @@ -225,17 +299,18 @@ class ofBaseVideo: virtual public ofBaseHasPixels, public ofBaseUpdates{ }; -//---------------------------------------------------------- -// ofBaseVideoDraws -//---------------------------------------------------------- -class ofBaseVideoDraws: virtual public ofBaseVideo, public ofBaseDraws, public ofBaseHasTexturePlanes,virtual public ofBaseHasPixels{ +/// \brief A base class representing a drawable video source. +class ofBaseVideoDraws: + virtual public ofBaseVideo, + public ofBaseDraws, + public ofBaseHasTexturePlanes, + virtual public ofBaseHasPixels{ public: + /// \brief Destroy the ofBaseVideoDraws. virtual ~ofBaseVideoDraws(){} }; -//---------------------------------------------------------- -// ofBaseVideoGrabber -//---------------------------------------------------------- +/// \brief A base class representing a video device such as a camera. class ofBaseVideoGrabber: virtual public ofBaseVideo{ public : @@ -249,7 +324,7 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ /// \brief Set up the grabber with the requested width and height. /// - /// Some video grabbers may not take the requested width and height as + /// Some video grabbers may take the requested width and height as /// a hint and choose the closest dimensions to those requested. /// Users can check the actual width and height by calling getWidth() and /// getHeight() respectively after a successful setup. @@ -257,15 +332,15 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ /// \param w the requested width. /// \param h the requested height. /// \returns true if the video grabber was set up successfully. - virtual bool setup(int w, int h) = 0; + virtual bool setup(int w, int h) = 0; /// \brief Get the video grabber's height. /// \returns the video grabbers height. - virtual float getHeight() const = 0; + virtual float getHeight() const = 0; /// \brief Get the video grabber's width. /// \returns the video grabbers width. - virtual float getWidth() const = 0; + virtual float getWidth() const = 0; /// \brief Get the video grabber's internal ofTexture pointer if available. /// @@ -302,9 +377,7 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ }; -//---------------------------------------------------------- -// ofBaseVideoPlayer -//---------------------------------------------------------- +/// \brief A base class representing a video player. class ofBaseVideoPlayer: virtual public ofBaseVideo{ public: From 4768ef26dd30ba31ab4b1c81d99842646e092b21 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 21 Oct 2014 12:47:22 -0500 Subject: [PATCH 03/34] Clean up spaces. --- libs/openFrameworks/types/ofBaseTypes.h | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/openFrameworks/types/ofBaseTypes.h b/libs/openFrameworks/types/ofBaseTypes.h index 0b0ddc9910c..0bd2525aa8b 100644 --- a/libs/openFrameworks/types/ofBaseTypes.h +++ b/libs/openFrameworks/types/ofBaseTypes.h @@ -60,14 +60,14 @@ class ofBaseDraws{ virtual void draw(const ofPoint & point, float w, float h) const { draw(point.x, point.y, w, h); } - + virtual float getHeight() const = 0; virtual float getWidth() const = 0; - + virtual void setAnchorPercent(float xPct, float yPct){}; virtual void setAnchorPoint(float x, float y){}; virtual void resetAnchor(){}; - + }; /// \brief An abstract class representing an object can be updated. @@ -312,7 +312,7 @@ class ofBaseVideoDraws: /// \brief A base class representing a video device such as a camera. class ofBaseVideoGrabber: virtual public ofBaseVideo{ - + public : /// \brief Destroy the ofBaseVideoGrabber virtual ~ofBaseVideoGrabber(); @@ -373,48 +373,48 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ /// \brief Request a native GUI for video grabber settings. /// \note This feature may not be implemented by all video grabbers. virtual void videoSettings(); - + }; /// \brief A base class representing a video player. class ofBaseVideoPlayer: virtual public ofBaseVideo{ - + public: virtual ~ofBaseVideoPlayer(); - + //needs implementing virtual bool load(string name) = 0; - + virtual void play() = 0; - virtual void stop() = 0; + virtual void stop() = 0; virtual ofTexture * getTexturePtr(){return NULL;}; // if your videoplayer needs to implement seperate texture and pixel returns for performance, implement this function to return a texture instead of a pixel array. see iPhoneVideoGrabber for reference - + virtual float getWidth() const = 0; virtual float getHeight() const = 0; - + virtual bool isPaused() const = 0; virtual bool isLoaded() const = 0; virtual bool isPlaying() const = 0; virtual bool isInitialized() const{ return isLoaded(); } - + //should implement! virtual float getPosition() const; virtual float getSpeed() const; virtual float getDuration() const; virtual bool getIsMovieDone() const; - + virtual void setPaused(bool bPause); virtual void setPosition(float pct); virtual void setVolume(float volume); // 0..1 virtual void setLoopState(ofLoopType state); virtual void setSpeed(float speed); virtual void setFrame(int frame); // frame 0 = first frame... - + virtual int getCurrentFrame() const; virtual int getTotalNumFrames() const; virtual ofLoopType getLoopState() const; - + virtual void firstFrame(); virtual void nextFrame(); virtual void previousFrame(); @@ -496,7 +496,7 @@ class ofBaseRenderer{ virtual void multViewMatrix(const ofMatrix4x4 & m)=0; virtual ofMatrix4x4 getCurrentViewMatrix() const=0; virtual ofMatrix4x4 getCurrentNormalMatrix() const=0; - + // screen coordinate things / default gl values virtual void setupGraphicDefaults()=0; virtual void setupScreen()=0; From 16bb58a444c0f8334044017f775a859bbe91a141 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 21 Oct 2014 12:48:29 -0500 Subject: [PATCH 04/34] Convert spaces to tabs to match existing. --- libs/openFrameworks/types/ofBaseTypes.h | 230 ++++++++++++------------ 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/libs/openFrameworks/types/ofBaseTypes.h b/libs/openFrameworks/types/ofBaseTypes.h index 0bd2525aa8b..394c80c2d6c 100644 --- a/libs/openFrameworks/types/ofBaseTypes.h +++ b/libs/openFrameworks/types/ofBaseTypes.h @@ -73,10 +73,10 @@ class ofBaseDraws{ /// \brief An abstract class representing an object can be updated. class ofBaseUpdates{ public: - /// \brief Destroy the ofBaseUpdates. + /// \brief Destroy the ofBaseUpdates. virtual ~ofBaseUpdates(){} - /// \brief Update the object's state. + /// \brief Update the object's state. virtual void update()=0; }; @@ -87,20 +87,20 @@ class ofTexture; /// \brief An abstract class representing an object that can has an ofTexture. class ofBaseHasTexture{ public: - /// \brief Destroy the ofBaseHasTexture. + /// \brief Destroy the ofBaseHasTexture. virtual ~ofBaseHasTexture(){} - /// \returns a reference the the ofTexture. + /// \returns a reference the the ofTexture. virtual ofTexture & getTexture()=0; - /// \returns a const reference the the ofTexture. + /// \returns a const reference the the ofTexture. virtual const ofTexture & getTexture() const=0; - /// \brief Enable or disable internal ofTexture use. - /// \param bUseTex true if an ofTexture should be used. + /// \brief Enable or disable internal ofTexture use. + /// \param bUseTex true if an ofTexture should be used. virtual void setUseTexture(bool bUseTex)=0; - /// \returns true if an internal ofTexture is being used. + /// \returns true if an internal ofTexture is being used. virtual bool isUsingTexture() const=0; }; @@ -108,13 +108,13 @@ class ofBaseHasTexture{ /// \brief An abstract class representing an object that ofTexture planes. class ofBaseHasTexturePlanes: public ofBaseHasTexture{ public: - /// \brief Destroy the ofBaseHasTexturePlanes. + /// \brief Destroy the ofBaseHasTexturePlanes. virtual ~ofBaseHasTexturePlanes(){} - /// \returns a reference to a std::vector containing the ofTexture planes. + /// \returns a reference to a std::vector containing the ofTexture planes. virtual vector & getTexturePlanes()=0; - /// \returns a const reference to a std::vector containing the ofTexture planes. + /// \returns a const reference to a std::vector containing the ofTexture planes. virtual const vector & getTexturePlanes() const=0; }; @@ -143,7 +143,7 @@ class ofBaseHasTexturePlanes: public ofBaseHasTexture{ /// \endcode class ofAbstractHasPixels{ public: - /// \brief Destroy the ofAbstractHasPixels. + /// \brief Destroy the ofAbstractHasPixels. virtual ~ofAbstractHasPixels(){} }; @@ -153,15 +153,15 @@ class ofAbstractHasPixels{ template class ofBaseHasPixels_: public ofAbstractHasPixels{ public: - /// \brief Destroy the ofAbstractHasPixels. + /// \brief Destroy the ofAbstractHasPixels. virtual ~ofBaseHasPixels_(){} - /// \brief Get a reference to the underlying ofPixels. - /// \returns a reference the underlying ofPixels. - virtual ofPixels_ & getPixels()=0; + /// \brief Get a reference to the underlying ofPixels. + /// \returns a reference the underlying ofPixels. + virtual ofPixels_ & getPixels()=0; - /// \brief Get a const reference to the underlying ofPixels. - /// \returns a const reference the underlying ofPixels. + /// \brief Get a const reference to the underlying ofPixels. + /// \returns a const reference the underlying ofPixels. virtual const ofPixels_ & getPixels() const=0; }; @@ -199,7 +199,7 @@ typedef ofBaseHasPixels_ ofBaseHasShortPixels; /// \endcode class ofAbstractImage: public ofBaseDraws, public ofBaseHasTexture{ public: - /// \brief Destroy the ofAbstractImage. + /// \brief Destroy the ofAbstractImage. virtual ~ofAbstractImage(){} }; @@ -208,7 +208,7 @@ class ofAbstractImage: public ofBaseDraws, public ofBaseHasTexture{ template class ofBaseImage_: public ofAbstractImage, virtual public ofBaseHasPixels_{ public: - /// \brief Destroy the ofBaseImage_. + /// \brief Destroy the ofBaseImage_. virtual ~ofBaseImage_(){}; }; @@ -227,86 +227,86 @@ typedef ofBaseImage_ ofBaseShortImage; /// \brief A base class representing a sound input stream. class ofBaseSoundInput{ public: - /// \brief Destroy the ofBaseSoundInput. - virtual ~ofBaseSoundInput() {}; + /// \brief Destroy the ofBaseSoundInput. + virtual ~ofBaseSoundInput() {}; - /// \todo - virtual void audioIn( float * input, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ - audioIn(input, bufferSize, nChannels); - } + /// \todo + virtual void audioIn( float * input, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ + audioIn(input, bufferSize, nChannels); + } - /// \todo - virtual void audioIn( float * input, int bufferSize, int nChannels ){ - audioReceived(input, bufferSize, nChannels); - } + /// \todo + virtual void audioIn( float * input, int bufferSize, int nChannels ){ + audioReceived(input, bufferSize, nChannels); + } - /// \todo - virtual void audioReceived( float * input, int bufferSize, int nChannels ){} + /// \todo + virtual void audioReceived( float * input, int bufferSize, int nChannels ){} }; /// \brief A base class representing a sound output stream. class ofBaseSoundOutput{ public: - /// \brief Destroy the ofBaseSoundOutput. - virtual ~ofBaseSoundOutput() {}; - - /// \todo - virtual void audioOut( float * output, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ - audioOut(output, bufferSize, nChannels); - } - - /// \todo - virtual void audioOut( float * output, int bufferSize, int nChannels ){ - audioRequested(output, bufferSize, nChannels); - } - - /// \todo - /// \note This is a legacy method. - virtual void audioRequested( float * output, int bufferSize, int nChannels ){ - } + /// \brief Destroy the ofBaseSoundOutput. + virtual ~ofBaseSoundOutput() {}; + + /// \todo + virtual void audioOut( float * output, int bufferSize, int nChannels, int deviceID, long unsigned long tickCount ){ + audioOut(output, bufferSize, nChannels); + } + + /// \todo + virtual void audioOut( float * output, int bufferSize, int nChannels ){ + audioRequested(output, bufferSize, nChannels); + } + + /// \todo + /// \note This is a legacy method. + virtual void audioRequested( float * output, int bufferSize, int nChannels ){ + } }; /// \brief A base class representing a video source. class ofBaseVideo: virtual public ofBaseHasPixels, public ofBaseUpdates{ public: - /// \brief Destroy the ofBaseVideo. + /// \brief Destroy the ofBaseVideo. virtual ~ofBaseVideo(){} - /// \returns true if the pixel data was updated since the last call to update(). + /// \returns true if the pixel data was updated since the last call to update(). virtual bool isFrameNew() const =0; - /// \brief Close the video source. + /// \brief Close the video source. virtual void close()=0; - /// \brief Determine if the video source is initialized. - /// - /// Video sources such as cameras are often initialized with a - /// setup() method. Video sources such as movie players are often - /// initialized with a load() method. - /// - /// \returns true if the video source is initialized. + /// \brief Determine if the video source is initialized. + /// + /// Video sources such as cameras are often initialized with a + /// setup() method. Video sources such as movie players are often + /// initialized with a load() method. + /// + /// \returns true if the video source is initialized. virtual bool isInitialized() const=0; - /// \brief Set the requested ofPixelFormat. - /// \param pixelFormat the requested ofPixelFormat. - /// \returns true if the format was successfully changed. + /// \brief Set the requested ofPixelFormat. + /// \param pixelFormat the requested ofPixelFormat. + /// \returns true if the format was successfully changed. virtual bool setPixelFormat(ofPixelFormat pixelFormat) = 0; - /// \returns the current ofPixelFormat. + /// \returns the current ofPixelFormat. virtual ofPixelFormat getPixelFormat() const = 0; }; /// \brief A base class representing a drawable video source. class ofBaseVideoDraws: - virtual public ofBaseVideo, - public ofBaseDraws, - public ofBaseHasTexturePlanes, - virtual public ofBaseHasPixels{ + virtual public ofBaseVideo, + public ofBaseDraws, + public ofBaseHasTexturePlanes, + virtual public ofBaseHasPixels{ public: - /// \brief Destroy the ofBaseVideoDraws. + /// \brief Destroy the ofBaseVideoDraws. virtual ~ofBaseVideoDraws(){} }; @@ -314,64 +314,64 @@ class ofBaseVideoDraws: class ofBaseVideoGrabber: virtual public ofBaseVideo{ public : - /// \brief Destroy the ofBaseVideoGrabber + /// \brief Destroy the ofBaseVideoGrabber virtual ~ofBaseVideoGrabber(); //needs implementing - /// \brief Get a list of available video grabber devices. - /// \returns a std::vector of ofVideoDevice objects. + /// \brief Get a list of available video grabber devices. + /// \returns a std::vector of ofVideoDevice objects. virtual vector listDevices() const = 0; - /// \brief Set up the grabber with the requested width and height. - /// - /// Some video grabbers may take the requested width and height as - /// a hint and choose the closest dimensions to those requested. - /// Users can check the actual width and height by calling getWidth() and - /// getHeight() respectively after a successful setup. - /// - /// \param w the requested width. - /// \param h the requested height. - /// \returns true if the video grabber was set up successfully. + /// \brief Set up the grabber with the requested width and height. + /// + /// Some video grabbers may take the requested width and height as + /// a hint and choose the closest dimensions to those requested. + /// Users can check the actual width and height by calling getWidth() and + /// getHeight() respectively after a successful setup. + /// + /// \param w the requested width. + /// \param h the requested height. + /// \returns true if the video grabber was set up successfully. virtual bool setup(int w, int h) = 0; - /// \brief Get the video grabber's height. - /// \returns the video grabbers height. + /// \brief Get the video grabber's height. + /// \returns the video grabbers height. virtual float getHeight() const = 0; - /// \brief Get the video grabber's width. - /// \returns the video grabbers width. + /// \brief Get the video grabber's width. + /// \returns the video grabbers width. virtual float getWidth() const = 0; - /// \brief Get the video grabber's internal ofTexture pointer if available. - /// - /// \note Subclasses should implement this method only if internal API can - /// upload video grabber pixels directly to an ofTexture. - /// - /// \returns the internal ofTexture pointer or NULL of not available. + /// \brief Get the video grabber's internal ofTexture pointer if available. + /// + /// \note Subclasses should implement this method only if internal API can + /// upload video grabber pixels directly to an ofTexture. + /// + /// \returns the internal ofTexture pointer or NULL of not available. virtual ofTexture * getTexturePtr(){ return NULL; } - /// \brief Set the video grabber's hardware verbosity level. - /// \param bTalkToMe true if verbose grabber logging feedback is required. + /// \brief Set the video grabber's hardware verbosity level. + /// \param bTalkToMe true if verbose grabber logging feedback is required. virtual void setVerbose(bool bTalkToMe); - /// \brief Set the video grabber's device ID. - /// - /// In most cases, a user can choose a specific grabber source by ID. This - /// device ID information should be available to the user via the - /// listDevices() method. - /// - /// \param deviceID The device ID provided by listDevices(). + /// \brief Set the video grabber's device ID. + /// + /// In most cases, a user can choose a specific grabber source by ID. This + /// device ID information should be available to the user via the + /// listDevices() method. + /// + /// \param deviceID The device ID provided by listDevices(). virtual void setDeviceID(int deviceID); - /// \brief Set the video grabber's desired frame rate. - /// - /// Many video grabbers support user-specified frame rates. This frame rate - /// should be considered a hint for the video grabber and is not guaranteed. - /// \param framerate the desired frame rate. + /// \brief Set the video grabber's desired frame rate. + /// + /// Many video grabbers support user-specified frame rates. This frame rate + /// should be considered a hint for the video grabber and is not guaranteed. + /// \param framerate the desired frame rate. virtual void setDesiredFrameRate(int framerate); - /// \brief Request a native GUI for video grabber settings. - /// \note This feature may not be implemented by all video grabbers. + /// \brief Request a native GUI for video grabber settings. + /// \note This feature may not be implemented by all video grabbers. virtual void videoSettings(); }; @@ -442,7 +442,7 @@ class ofBaseRenderer{ } virtual void draw(const ofMesh & vertexData, bool useColors, bool useTextures, bool useNormals) const=0; virtual void draw(const ofMesh & vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals) const=0; - virtual void draw(const of3dPrimitive& model, ofPolyRenderMode renderType) const=0; + virtual void draw(const of3dPrimitive& model, ofPolyRenderMode renderType) const=0; virtual void draw(const ofImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0; virtual void draw(const ofFloatImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0; virtual void draw(const ofShortImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0; @@ -605,13 +605,13 @@ class ofBaseFileSerializer: public ofBaseSerializer{ class ofBaseURLFileLoader{ public: virtual ~ofBaseURLFileLoader(){}; - virtual ofHttpResponse get(string url)=0; - virtual int getAsync(string url, string name="")=0; - virtual ofHttpResponse saveTo(string url, string path)=0; - virtual int saveAsync(string url, string path)=0; - virtual void remove(int id)=0; - virtual void clear()=0; - virtual void stop()=0; + virtual ofHttpResponse get(string url)=0; + virtual int getAsync(string url, string name="")=0; + virtual ofHttpResponse saveTo(string url, string path)=0; + virtual int saveAsync(string url, string path)=0; + virtual void remove(int id)=0; + virtual void clear()=0; + virtual void stop()=0; }; class ofBaseMaterial{ From 25ba876b4360e7b13c2de208f0c63e30b15c7f92 Mon Sep 17 00:00:00 2001 From: Michael Hadley Date: Tue, 21 Oct 2014 14:53:52 -0500 Subject: [PATCH 05/34] Minor grammar/code example fixes --- libs/openFrameworks/types/ofBaseTypes.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/openFrameworks/types/ofBaseTypes.h b/libs/openFrameworks/types/ofBaseTypes.h index 394c80c2d6c..cfd7cd5cb46 100644 --- a/libs/openFrameworks/types/ofBaseTypes.h +++ b/libs/openFrameworks/types/ofBaseTypes.h @@ -70,7 +70,7 @@ class ofBaseDraws{ }; -/// \brief An abstract class representing an object can be updated. +/// \brief An abstract class representing an object that can be updated. class ofBaseUpdates{ public: /// \brief Destroy the ofBaseUpdates. @@ -84,16 +84,16 @@ class ofBaseUpdates{ class ofTexture; -/// \brief An abstract class representing an object that can has an ofTexture. +/// \brief An abstract class representing an object that can have an ofTexture. class ofBaseHasTexture{ public: /// \brief Destroy the ofBaseHasTexture. virtual ~ofBaseHasTexture(){} - /// \returns a reference the the ofTexture. + /// \returns a reference to the ofTexture. virtual ofTexture & getTexture()=0; - /// \returns a const reference the the ofTexture. + /// \returns a const reference to the ofTexture. virtual const ofTexture & getTexture() const=0; /// \brief Enable or disable internal ofTexture use. @@ -192,9 +192,9 @@ typedef ofBaseHasPixels_ ofBaseHasShortPixels; /// /// // ... /// -/// imageProviders(&image); -/// imageProviders(&floatImage); -/// imageProviders(&shortImage); +/// imageProviders.push_back(&image); +/// imageProviders.push_back(&floatImage); +/// imageProviders.push_back(&shortImage); /// /// \endcode class ofAbstractImage: public ofBaseDraws, public ofBaseHasTexture{ @@ -335,11 +335,11 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ virtual bool setup(int w, int h) = 0; /// \brief Get the video grabber's height. - /// \returns the video grabbers height. + /// \returns the video grabber's height. virtual float getHeight() const = 0; /// \brief Get the video grabber's width. - /// \returns the video grabbers width. + /// \returns the video grabber's width. virtual float getWidth() const = 0; /// \brief Get the video grabber's internal ofTexture pointer if available. @@ -347,7 +347,7 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ /// \note Subclasses should implement this method only if internal API can /// upload video grabber pixels directly to an ofTexture. /// - /// \returns the internal ofTexture pointer or NULL of not available. + /// \returns the internal ofTexture pointer or NULL if not available. virtual ofTexture * getTexturePtr(){ return NULL; } /// \brief Set the video grabber's hardware verbosity level. @@ -367,6 +367,7 @@ class ofBaseVideoGrabber: virtual public ofBaseVideo{ /// /// Many video grabbers support user-specified frame rates. This frame rate /// should be considered a hint for the video grabber and is not guaranteed. + /// /// \param framerate the desired frame rate. virtual void setDesiredFrameRate(int framerate); From 59b60311ceaf3e1b4d9496faa3342380f122c0f4 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 28 Jul 2014 20:37:10 -0500 Subject: [PATCH 06/34] Remove old poco patches. (cherry picked from commit 56e45cd2c37e678daf1a6603e373634169fadf75) --- .../apothecary/formulas/{poco => }/poco.sh | 0 .../formulas/poco/poco.headers.patch | 984 ------------------ 2 files changed, 984 deletions(-) rename scripts/apothecary/formulas/{poco => }/poco.sh (100%) delete mode 100644 scripts/apothecary/formulas/poco/poco.headers.patch diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco.sh similarity index 100% rename from scripts/apothecary/formulas/poco/poco.sh rename to scripts/apothecary/formulas/poco.sh diff --git a/scripts/apothecary/formulas/poco/poco.headers.patch b/scripts/apothecary/formulas/poco/poco.headers.patch deleted file mode 100644 index 00c0ee0e60a..00000000000 --- a/scripts/apothecary/formulas/poco/poco.headers.patch +++ /dev/null @@ -1,984 +0,0 @@ -Only in work-Poco/: .DS_Store -diff -ru Poco/AbstractDelegate.h work-Poco/AbstractDelegate.h ---- Poco/AbstractDelegate.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/AbstractDelegate.h 2013-09-26 16:00:50.000000000 +0100 -@@ -85,6 +85,44 @@ - } - }; - -+template <> -+class AbstractDelegate -+ /// Base class for Delegate and Expire. -+{ -+public: -+ AbstractDelegate() -+ { -+ } -+ -+ AbstractDelegate(const AbstractDelegate& del) -+ { -+ } -+ -+ virtual ~AbstractDelegate() -+ { -+ } -+ -+ virtual bool notify(const void* sender) = 0; -+ /// Invokes the delegate's callback function. -+ /// Returns true if successful, or false if the delegate -+ /// has been disabled or has expired. -+ -+ virtual bool equals(const AbstractDelegate& other) const = 0; -+ /// Compares the AbstractDelegate with the other one for equality. -+ -+ virtual AbstractDelegate* clone() const = 0; -+ /// Returns a deep copy of the AbstractDelegate. -+ -+ virtual void disable() = 0; -+ /// Disables the delegate, which is done prior to removal. -+ -+ virtual const AbstractDelegate* unwrap() const -+ /// Returns the unwrapped delegate. Must be overridden by decorators -+ /// like Expire. -+ { -+ return this; -+ } -+}; - - } // namespace Poco - -diff -ru Poco/AbstractEvent.h work-Poco/AbstractEvent.h ---- Poco/AbstractEvent.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/AbstractEvent.h 2013-09-26 16:06:19.000000000 +0100 -@@ -346,6 +346,296 @@ - AbstractEvent& operator = (const AbstractEvent& other); - }; - -+template -+class AbstractEvent -+ /// An AbstractEvent is the base class of all events. -+ /// It works similar to the way C# handles notifications (aka events in C#). -+ /// -+ /// Events can be used to send information to a set of delegates -+ /// which are registered with the event. The type of the data is specified with -+ /// the template parameter TArgs. The TStrategy parameter must be a subclass -+ /// of NotificationStrategy. The parameter TDelegate can either be a subclass of AbstractDelegate -+ /// or of AbstractPriorityDelegate. -+ /// -+ /// Note that AbstractEvent should never be used directly. One ought to use -+ /// one of its subclasses which set the TStrategy and TDelegate template parameters -+ /// to fixed values. For most use-cases the BasicEvent template will be sufficient: -+ /// -+ /// #include "Poco/BasicEvent.h" -+ /// #include "Poco/Delegate.h" -+ /// -+ /// Note that as of release 1.4.2, the behavior of BasicEvent equals that of FIFOEvent, -+ /// so the FIFOEvent class is no longer necessary and provided for backwards compatibility -+ /// only. -+ /// -+ /// BasicEvent works with a standard delegate. They allow one object to register -+ /// onr or more delegates with an event. In contrast, a PriorityDelegate comes with an attached priority value -+ /// and allows one object to register for one priority value one or more delegates. Note that PriorityDelegates -+ /// only work with PriorityEvents: -+ /// -+ /// #include "Poco/PriorityEvent.h" -+ /// #include "Poco/PriorityDelegate.h" -+ /// -+ /// Use events by adding them as public members to the object which is throwing notifications: -+ /// -+ /// class MyData -+ /// { -+ /// public: -+ /// Poco::BasicEvent dataChanged; -+ /// -+ /// MyData(); -+ /// ... -+ /// void setData(int i); -+ /// ... -+ /// private: -+ /// int _data; -+ /// }; -+ /// -+ /// Firing the event is done either by calling the event's notify() or notifyAsync() method: -+ /// -+ /// void MyData::setData(int i) -+ /// { -+ /// this->_data = i; -+ /// dataChanged.notify(this, this->_data); -+ /// } -+ /// -+ /// Alternatively, instead of notify(), operator () can be used. -+ /// -+ /// void MyData::setData(int i) -+ /// { -+ /// this->_data = i; -+ /// dataChanged(this, this->_data); -+ /// } -+ /// -+ /// Note that operator (), notify() and notifyAsync() do not catch exceptions, i.e. in case a -+ /// delegate throws an exception, notifying is immediately aborted and the exception is propagated -+ /// back to the caller. -+ /// -+ /// Delegates can register methods at the event. In the case of a BasicEvent -+ /// the Delegate template is used, in case of an PriorityEvent a PriorityDelegate is used. -+ /// Mixing of delegates, e.g. using a PriorityDelegate with a BasicEvent is not allowed and -+ /// can lead to compile-time and/or run-time errors. The standalone delegate() functions -+ /// can be used to construct Delegate objects. -+ /// -+ /// Events require the observers to have one of the following method signatures: -+ /// -+ /// void onEvent(const void* pSender, TArgs& args); -+ /// void onEvent(TArgs& args); -+ /// static void onEvent(const void* pSender, TArgs& args); -+ /// static void onEvent(void* pSender, TArgs& args); -+ /// static void onEvent(TArgs& args); -+ /// -+ /// For performance reasons arguments are always sent by reference. This also allows observers -+ /// to modify the event argument. To prevent that, use <[const TArg]> as template -+ /// parameter. A non-conformant method signature leads to compile errors. -+ /// -+ /// Assuming that the observer meets the method signature requirement, it can register -+ /// this method with the += operator: -+ /// -+ /// class MyController -+ /// { -+ /// protected: -+ /// MyData _data; -+ /// -+ /// void onDataChanged(void* pSender, int& data); -+ /// ... -+ /// }; -+ /// -+ /// MyController::MyController() -+ /// { -+ /// _data.dataChanged += delegate(this, &MyController::onDataChanged); -+ /// } -+ /// -+ /// In some cases it might be desirable to work with automatically expiring registrations. Simply add -+ /// to delegate as 3rd parameter a expireValue (in milliseconds): -+ /// -+ /// _data.dataChanged += delegate(this, &MyController::onDataChanged, 1000); -+ /// -+ /// This will add a delegate to the event which will automatically be removed in 1000 millisecs. -+ /// -+ /// Unregistering happens via the -= operator. Forgetting to unregister a method will lead to -+ /// segmentation faults later, when one tries to send a notify to a no longer existing object. -+ /// -+ /// MyController::~MyController() -+ /// { -+ /// _data.dataChanged -= delegate(this, &MyController::onDataChanged); -+ /// } -+ /// -+ /// Working with PriorityDelegate's as similar to working with BasicEvent. -+ /// Instead of delegate(), the priorityDelegate() function must be used -+ /// to create the PriorityDelegate. -+{ -+public: -+ AbstractEvent(): -+ _executeAsync(this, &AbstractEvent::executeAsyncImpl), -+ _enabled(true) -+ { -+ } -+ -+ AbstractEvent(const TStrategy& strat): -+ _executeAsync(this, &AbstractEvent::executeAsyncImpl), -+ _strategy(strat), -+ _enabled(true) -+ { -+ } -+ -+ virtual ~AbstractEvent() -+ { -+ } -+ -+ void operator += (const TDelegate& aDelegate) -+ /// Adds a delegate to the event. -+ /// -+ /// Exact behavior is determined by the TStrategy. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ _strategy.add(aDelegate); -+ } -+ -+ void operator -= (const TDelegate& aDelegate) -+ /// Removes a delegate from the event. -+ /// -+ /// If the delegate is not found, this function does nothing. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ _strategy.remove(aDelegate); -+ } -+ -+ void operator () (const void* pSender) -+ /// Shortcut for notify(pSender, args); -+ { -+ notify(pSender); -+ } -+ -+ void operator () () -+ /// Shortcut for notify(args). -+ { -+ notify(0); -+ } -+ -+ void notify(const void* pSender) -+ /// Sends a notification to all registered delegates. The order is -+ /// determined by the TStrategy. This method is blocking. While executing, -+ /// the list of delegates may be modified. These changes don't -+ /// influence the current active notifications but are activated with -+ /// the next notify. If a delegate is removed during a notify(), the -+ /// delegate will no longer be invoked (unless it has already been -+ /// invoked prior to removal). If one of the delegates throws an exception, -+ /// the notify method is immediately aborted and the exception is propagated -+ /// to the caller. -+ { -+ Poco::ScopedLockWithUnlock lock(_mutex); -+ -+ if (!_enabled) return; -+ -+ // thread-safeness: -+ // copy should be faster and safer than blocking until -+ // execution ends -+ TStrategy strategy(_strategy); -+ lock.unlock(); -+ strategy.notify(pSender); -+ } -+ -+ ActiveResult notifyAsync(const void* pSender) -+ /// Sends a notification to all registered delegates. The order is -+ /// determined by the TStrategy. This method is not blocking and will -+ /// immediately return. The delegates are invoked in a seperate thread. -+ /// Call activeResult.wait() to wait until the notification has ended. -+ /// While executing, other objects can change the delegate list. These changes don't -+ /// influence the current active notifications but are activated with -+ /// the next notify. If a delegate is removed during a notify(), the -+ /// delegate will no longer be invoked (unless it has already been -+ /// invoked prior to removal). If one of the delegates throws an exception, -+ /// the execution is aborted and the exception is propagated to the caller. -+ { -+ NotifyAsyncParams params(pSender); -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ -+ // thread-safeness: -+ // copy should be faster and safer than blocking until -+ // execution ends -+ // make a copy of the strategy here to guarantee that -+ // between notifyAsync and the execution of the method no changes can occur -+ -+ params.ptrStrat = SharedPtr(new TStrategy(_strategy)); -+ params.enabled = _enabled; -+ } -+ ActiveResult result = _executeAsync(params); -+ return result; -+ } -+ -+ void enable() -+ /// Enables the event. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ _enabled = true; -+ } -+ -+ void disable() -+ /// Disables the event. notify and notifyAsnyc will be ignored, -+ /// but adding/removing delegates is still allowed. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ _enabled = false; -+ } -+ -+ bool isEnabled() const -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ return _enabled; -+ } -+ -+ void clear() -+ /// Removes all delegates. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ _strategy.clear(); -+ } -+ -+ bool empty() const -+ /// Checks if any delegates are registered at the delegate. -+ { -+ typename TMutex::ScopedLock lock(_mutex); -+ return _strategy.empty(); -+ } -+ -+protected: -+ struct NotifyAsyncParams -+ { -+ SharedPtr ptrStrat; -+ const void* pSender; -+ bool enabled; -+ -+ NotifyAsyncParams(const void* pSend):ptrStrat(), pSender(pSend), enabled(true) -+ /// Default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed. -+ { -+ } -+ }; -+ -+ ActiveMethod _executeAsync; -+ -+ void executeAsyncImpl(const NotifyAsyncParams& par) -+ { -+ if (!par.enabled) -+ { -+ return; -+ } -+ -+ NotifyAsyncParams params = par; -+ params.ptrStrat->notify(params.pSender); -+ return; -+ } -+ -+ TStrategy _strategy; /// The strategy used to notify observers. -+ bool _enabled; /// Stores if an event is enabled. Notfies on disabled events have no effect -+ /// but it is possible to change the observers. -+ mutable TMutex _mutex; -+ -+private: -+ AbstractEvent(const AbstractEvent& other); -+ AbstractEvent& operator = (const AbstractEvent& other); -+}; - - } // namespace Poco - -diff -ru Poco/FunctionPriorityDelegate.h work-Poco/FunctionPriorityDelegate.h ---- Poco/FunctionPriorityDelegate.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/FunctionPriorityDelegate.h 2013-09-26 16:02:50.000000000 +0100 -@@ -260,6 +260,214 @@ - }; - - -+template <> -+class FunctionPriorityDelegate: public AbstractPriorityDelegate -+ /// Wraps a freestanding function or static member function -+ /// for use as a PriorityDelegate. -+{ -+public: -+ typedef void (*NotifyMethod)(const void*); -+ -+ FunctionPriorityDelegate(NotifyMethod method, int prio): -+ AbstractPriorityDelegate(prio), -+ _receiverMethod(method) -+ { -+ } -+ -+ FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): -+ AbstractPriorityDelegate(delegate), -+ _receiverMethod(delegate._receiverMethod) -+ { -+ } -+ -+ FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) -+ { -+ if (&delegate != this) -+ { -+ this->_receiverMethod = delegate._receiverMethod; -+ this->_priority = delegate._priority; -+ } -+ return *this; -+ } -+ -+ ~FunctionPriorityDelegate() -+ { -+ } -+ -+ bool notify(const void* sender) -+ { -+ Mutex::ScopedLock lock(_mutex); -+ if (_receiverMethod) -+ { -+ (*_receiverMethod)(sender); -+ return true; -+ } -+ else return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); -+ return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; -+ } -+ -+ AbstractDelegate* clone() const -+ { -+ return new FunctionPriorityDelegate(*this); -+ } -+ -+ void disable() -+ { -+ Mutex::ScopedLock lock(_mutex); -+ _receiverMethod = 0; -+ } -+ -+protected: -+ NotifyMethod _receiverMethod; -+ Mutex _mutex; -+ -+private: -+ FunctionPriorityDelegate(); -+}; -+ -+ -+template <> -+class FunctionPriorityDelegate: public AbstractPriorityDelegate -+{ -+public: -+ typedef void (*NotifyMethod)(void*); -+ -+ FunctionPriorityDelegate(NotifyMethod method, int prio): -+ AbstractPriorityDelegate(prio), -+ _receiverMethod(method) -+ { -+ } -+ -+ FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): -+ AbstractPriorityDelegate(delegate), -+ _receiverMethod(delegate._receiverMethod) -+ { -+ } -+ -+ FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) -+ { -+ if (&delegate != this) -+ { -+ this->_receiverMethod = delegate._receiverMethod; -+ this->_priority = delegate._priority; -+ } -+ return *this; -+ } -+ -+ ~FunctionPriorityDelegate() -+ { -+ } -+ -+ bool notify(const void* sender) -+ { -+ Mutex::ScopedLock lock(_mutex); -+ if (_receiverMethod) -+ { -+ (*_receiverMethod)(const_cast(sender)); -+ return true; -+ } -+ else return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); -+ return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; -+ } -+ -+ AbstractDelegate* clone() const -+ { -+ return new FunctionPriorityDelegate(*this); -+ } -+ -+ void disable() -+ { -+ Mutex::ScopedLock lock(_mutex); -+ _receiverMethod = 0; -+ } -+ -+protected: -+ NotifyMethod _receiverMethod; -+ Mutex _mutex; -+ -+private: -+ FunctionPriorityDelegate(); -+}; -+ -+ -+template <> -+class FunctionPriorityDelegate: public AbstractPriorityDelegate -+{ -+public: -+ typedef void (*NotifyMethod)(); -+ -+ FunctionPriorityDelegate(NotifyMethod method, int prio): -+ AbstractPriorityDelegate(prio), -+ _receiverMethod(method) -+ { -+ } -+ -+ FunctionPriorityDelegate(const FunctionPriorityDelegate& delegate): -+ AbstractPriorityDelegate(delegate), -+ _receiverMethod(delegate._receiverMethod) -+ { -+ } -+ -+ FunctionPriorityDelegate& operator = (const FunctionPriorityDelegate& delegate) -+ { -+ if (&delegate != this) -+ { -+ this->_receiverMethod = delegate._receiverMethod; -+ this->_priority = delegate._priority; -+ } -+ return *this; -+ } -+ -+ ~FunctionPriorityDelegate() -+ { -+ } -+ -+ bool notify(const void* sender) -+ { -+ Mutex::ScopedLock lock(_mutex); -+ if (_receiverMethod) -+ { -+ (*_receiverMethod)(); -+ return true; -+ } -+ else return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ const FunctionPriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); -+ return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverMethod == pOtherDelegate->_receiverMethod; -+ } -+ -+ AbstractDelegate* clone() const -+ { -+ return new FunctionPriorityDelegate(*this); -+ } -+ -+ void disable() -+ { -+ Mutex::ScopedLock lock(_mutex); -+ _receiverMethod = 0; -+ } -+ -+protected: -+ NotifyMethod _receiverMethod; -+ Mutex _mutex; -+ -+private: -+ FunctionPriorityDelegate(); -+}; -+ - } // namespace Poco - - -diff -ru Poco/Net/X509Certificate.h work-Poco/Net/X509Certificate.h ---- Poco/Net/X509Certificate.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/Net/X509Certificate.h 2013-09-26 16:03:48.000000000 +0100 -@@ -87,7 +87,9 @@ - - ~X509Certificate(); - /// Destroys the X509Certificate. -- -+#ifdef verify -+#undef verify -+#endif - bool verify(const std::string& hostName) const; - /// Verifies the validity of the certificate against the host name. - /// -diff -ru Poco/PriorityDelegate.h work-Poco/PriorityDelegate.h ---- Poco/PriorityDelegate.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/PriorityDelegate.h 2013-09-26 16:04:35.000000000 +0100 -@@ -198,6 +198,152 @@ - }; - - -+template -+class PriorityDelegate: public AbstractPriorityDelegate -+{ -+public: -+ typedef void (TObj::*NotifyMethod)(const void*); -+ -+ PriorityDelegate(TObj* obj, NotifyMethod method, int prio): -+ AbstractPriorityDelegate(prio), -+ _receiverObject(obj), -+ _receiverMethod(method) -+ { -+ } -+ -+ PriorityDelegate(const PriorityDelegate& delegate): -+ AbstractPriorityDelegate(delegate), -+ _receiverObject(delegate._receiverObject), -+ _receiverMethod(delegate._receiverMethod) -+ { -+ } -+ -+ PriorityDelegate& operator = (const PriorityDelegate& delegate) -+ { -+ if (&delegate != this) -+ { -+ this->_pTarget = delegate._pTarget; -+ this->_receiverObject = delegate._receiverObject; -+ this->_receiverMethod = delegate._receiverMethod; -+ this->_priority = delegate._priority; -+ } -+ return *this; -+ } -+ -+ ~PriorityDelegate() -+ { -+ } -+ -+ bool notify(const void* sender) -+ { -+ Mutex::ScopedLock lock(_mutex); -+ if (_receiverObject) -+ { -+ (_receiverObject->*_receiverMethod)(sender); -+ return true; -+ } -+ else return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); -+ return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; -+ } -+ -+ AbstractDelegate* clone() const -+ { -+ return new PriorityDelegate(*this); -+ } -+ -+ void disable() -+ { -+ Mutex::ScopedLock lock(_mutex); -+ _receiverObject = 0; -+ } -+ -+protected: -+ TObj* _receiverObject; -+ NotifyMethod _receiverMethod; -+ Mutex _mutex; -+ -+private: -+ PriorityDelegate(); -+}; -+ -+template -+class PriorityDelegate: public AbstractPriorityDelegate -+{ -+public: -+ typedef void (TObj::*NotifyMethod)(); -+ -+ PriorityDelegate(TObj* obj, NotifyMethod method, int prio): -+ AbstractPriorityDelegate(prio), -+ _receiverObject(obj), -+ _receiverMethod(method) -+ { -+ } -+ -+ PriorityDelegate(const PriorityDelegate& delegate): -+ AbstractPriorityDelegate(delegate), -+ _receiverObject(delegate._receiverObject), -+ _receiverMethod(delegate._receiverMethod) -+ { -+ } -+ -+ PriorityDelegate& operator = (const PriorityDelegate& delegate) -+ { -+ if (&delegate != this) -+ { -+ this->_pTarget = delegate._pTarget; -+ this->_receiverObject = delegate._receiverObject; -+ this->_receiverMethod = delegate._receiverMethod; -+ this->_priority = delegate._priority; -+ } -+ return *this; -+ } -+ -+ ~PriorityDelegate() -+ { -+ } -+ -+ bool notify(const void* sender) -+ { -+ Mutex::ScopedLock lock(_mutex); -+ if (_receiverObject) -+ { -+ (_receiverObject->*_receiverMethod)(); -+ return true; -+ } -+ return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ const PriorityDelegate* pOtherDelegate = dynamic_cast(other.unwrap()); -+ return pOtherDelegate && this->priority() == pOtherDelegate->priority() && _receiverObject == pOtherDelegate->_receiverObject && _receiverMethod == pOtherDelegate->_receiverMethod; -+ } -+ -+ AbstractDelegate* clone() const -+ { -+ return new PriorityDelegate(*this); -+ } -+ -+ void disable() -+ { -+ Mutex::ScopedLock lock(_mutex); -+ _receiverObject = 0; -+ } -+ -+protected: -+ TObj* _receiverObject; -+ NotifyMethod _receiverMethod; -+ Mutex _mutex; -+ -+private: -+ PriorityDelegate(); -+}; -+ - template - static PriorityDelegate priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*, TArgs&), int prio) - { -@@ -268,6 +414,73 @@ - } - - -+ -+ -+ -+template -+static PriorityDelegate priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*), int prio) -+{ -+ return PriorityDelegate(pObj, NotifyMethod, prio); -+} -+ -+ -+template -+static PriorityDelegate priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(), int prio) -+{ -+ return PriorityDelegate(pObj, NotifyMethod, prio); -+} -+ -+ -+template -+static PriorityExpire priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(const void*), int prio, Timestamp::TimeDiff expireMilliSec) -+{ -+ return PriorityExpire(PriorityDelegate(pObj, NotifyMethod, prio), expireMilliSec); -+} -+ -+ -+template -+static PriorityExpire priorityDelegate(TObj* pObj, void (TObj::*NotifyMethod)(), int prio, Timestamp::TimeDiff expireMilliSec) -+{ -+ return PriorityExpire(PriorityDelegate(pObj, NotifyMethod, prio), expireMilliSec); -+} -+ -+ -+inline PriorityExpire priorityDelegate(void (*NotifyMethod)(const void*), int prio, Timestamp::TimeDiff expireMilliSec) -+{ -+ return PriorityExpire(FunctionPriorityDelegate(NotifyMethod, prio), expireMilliSec); -+} -+ -+ -+inline PriorityExpire priorityDelegate(void (*NotifyMethod)(void*), int prio, Timestamp::TimeDiff expireMilliSec) -+{ -+ return PriorityExpire(FunctionPriorityDelegate(NotifyMethod, prio), expireMilliSec); -+} -+ -+ -+inline PriorityExpire priorityDelegate(void (*NotifyMethod)(), int prio, Timestamp::TimeDiff expireMilliSec) -+{ -+ return PriorityExpire(FunctionPriorityDelegate(NotifyMethod, prio), expireMilliSec); -+} -+ -+ -+inline FunctionPriorityDelegate priorityDelegate(void (*NotifyMethod)(const void*), int prio) -+{ -+ return FunctionPriorityDelegate(NotifyMethod, prio); -+} -+ -+ -+inline FunctionPriorityDelegate priorityDelegate(void (*NotifyMethod)(void*), int prio) -+{ -+ return FunctionPriorityDelegate(NotifyMethod, prio); -+} -+ -+ -+inline FunctionPriorityDelegate priorityDelegate(void (*NotifyMethod)(), int prio) -+{ -+ return FunctionPriorityDelegate(NotifyMethod, prio); -+} -+ -+ - } // namespace Poco - - -diff -ru Poco/PriorityExpire.h work-Poco/PriorityExpire.h ---- Poco/PriorityExpire.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/PriorityExpire.h 2013-09-26 16:02:21.000000000 +0100 -@@ -129,7 +129,85 @@ - PriorityExpire(); - }; - -+template <> -+class PriorityExpire: public AbstractPriorityDelegate -+ /// Decorator for AbstractPriorityDelegate adding automatic -+ /// expiring of registrations to AbstractPriorityDelegate. -+{ -+public: -+ PriorityExpire(const AbstractPriorityDelegate& p, Timestamp::TimeDiff expireMilliSec): -+ AbstractPriorityDelegate(p), -+ _pDelegate(static_cast*>(p.clone())), -+ _expire(expireMilliSec*1000) -+ { -+ } - -+ PriorityExpire(const PriorityExpire& expire): -+ AbstractPriorityDelegate(expire), -+ _pDelegate(static_cast*>(expire._pDelegate->clone())), -+ _expire(expire._expire), -+ _creationTime(expire._creationTime) -+ { -+ } -+ -+ ~PriorityExpire() -+ { -+ delete _pDelegate; -+ } -+ -+ PriorityExpire& operator = (const PriorityExpire& expire) -+ { -+ if (&expire != this) -+ { -+ delete this->_pDelegate; -+ this->_pDelegate = static_cast*>(expire._pDelegate->clone()); -+ this->_expire = expire._expire; -+ this->_creationTime = expire._creationTime; -+ } -+ return *this; -+ } -+ -+ bool notify(const void* sender) -+ { -+ if (!expired()) -+ return this->_pDelegate->notify(sender); -+ else -+ return false; -+ } -+ -+ bool equals(const AbstractDelegate& other) const -+ { -+ return other.equals(*_pDelegate); -+ } -+ -+ AbstractPriorityDelegate* clone() const -+ { -+ return new PriorityExpire(*this); -+ } -+ -+ void disable() -+ { -+ _pDelegate->disable(); -+ } -+ -+ const AbstractPriorityDelegate* unwrap() const -+ { -+ return this->_pDelegate; -+ } -+ -+protected: -+ bool expired() const -+ { -+ return _creationTime.isElapsed(_expire); -+ } -+ -+ AbstractPriorityDelegate* _pDelegate; -+ Timestamp::TimeDiff _expire; -+ Timestamp _creationTime; -+ -+private: -+ PriorityExpire(); -+}; - } // namespace Poco - - -diff -ru Poco/PriorityStrategy.h work-Poco/PriorityStrategy.h ---- Poco/PriorityStrategy.h 2013-09-26 16:11:44.000000000 +0100 -+++ work-Poco/PriorityStrategy.h 2013-09-26 16:02:39.000000000 +0100 -@@ -135,7 +135,80 @@ - Delegates _delegates; - }; - -+template -+class PriorityStrategy -+ /// NotificationStrategy for PriorityEvent. -+ /// -+ /// Delegates are kept in a std::vector<>, ordered -+ /// by their priority. -+{ -+public: -+ typedef SharedPtr DelegatePtr; -+ typedef std::vector Delegates; -+ typedef typename Delegates::iterator Iterator; - -+public: -+ -+ void notify(const void* sender) -+ { -+ for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) -+ { -+ (*it)->notify(sender); -+ } -+ } -+ -+ void add(const TDelegate& delegate) -+ { -+ for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) -+ { -+ if ((*it)->priority() > delegate.priority()) -+ { -+ _delegates.insert(it, DelegatePtr(static_cast(delegate.clone()))); -+ return; -+ } -+ } -+ _delegates.push_back(DelegatePtr(static_cast(delegate.clone()))); -+ } -+ -+ void remove(const TDelegate& delegate) -+ { -+ for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) -+ { -+ if (delegate.equals(**it)) -+ { -+ (*it)->disable(); -+ _delegates.erase(it); -+ return; -+ } -+ } -+ } -+ -+ PriorityStrategy& operator = (const PriorityStrategy& s) -+ { -+ if (this != &s) -+ { -+ _delegates = s._delegates; -+ } -+ return *this; -+ } -+ -+ void clear() -+ { -+ for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it) -+ { -+ (*it)->disable(); -+ } -+ _delegates.clear(); -+ } -+ -+ bool empty() const -+ { -+ return _delegates.empty(); -+ } -+ -+protected: -+ Delegates _delegates; -+}; - } // namespace Poco - - From c9d8cc0ebf953fcbb822ab59ea3bf313cb50aebe Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 28 Jul 2014 20:37:37 -0500 Subject: [PATCH 07/34] Poco 1.5.3, Add Data/SQLite. (cherry picked from commit 31da9409a0068a9e9fd2eee8d4afd4f46924701c) --- scripts/apothecary/formulas/poco.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 8582c2e38f9..09cb48621a6 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=1.5.2-release +VER=1.5.3-release # tools for git use GIT_URL=https://github.com/pocoproject/poco @@ -52,7 +52,7 @@ function prepare() { function build() { if [ "$TYPE" == "osx" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" # 32 bit ./configure $BUILD_OPTS --config=Darwin32 @@ -77,7 +77,7 @@ function build() { done elif [ "$TYPE" == "osx-clang-libc++" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" # @tgfrerer: osx libraries in openFrameworks/master are currently "lean" 32 bit libraries. # so we omit the 64 bit compilation target for now. @@ -111,7 +111,7 @@ function build() { elif [ "$TYPE" == "ios" ] ; then # maybe --poquito is a good idea? - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC,NetSSL_OpenSSL,Crypto" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC,NetSSL_OpenSSL,Crypto" cp build/config/iPhone.orig build/config/iPhone cp build/config/iPhoneSimulator.orig build/config/iPhoneSimulator @@ -156,25 +156,25 @@ function build() { echoWarning "TODO: android build" elif [ "$TYPE" == "linux" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/i386/*d.a elif [ "$TYPE" == "linux64" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/x86_64/*d.a elif [ "$TYPE" == "linuxarmv6l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/armv6l/*d.a elif [ "$TYPE" == "linuxarmv7l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/SQLite,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" ./configure $BUILD_OPTS make # delete debug builds From 5d51743d5f873e298ba07e0fd28ab0ad329e9e3e Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 29 Jul 2014 02:35:24 +0000 Subject: [PATCH 08/34] Removed patch from poco formula. (cherry picked from commit 1092ee79e609e1ffac86ad52fe2d43b944a4954b) --- scripts/apothecary/formulas/poco.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 09cb48621a6..644a97c9438 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -200,11 +200,6 @@ function copy() { cp -Rv XML/include/Poco/* $1/include/Poco cp -Rv Zip/include/Poco/Zip $1/include/Poco - # @tgfrerer: apply header file patches necessary for events - if patch -d $1/include/Poco -p1 -d -N --dry-run --silent < $FORMULA_DIR/poco.headers.patch 2>/dev/null ; then - patch -d $1/include/Poco -p1 < $FORMULA_DIR/poco.headers.patch - fi - # libs if [ "$TYPE" == "osx" ] ; then mkdir -p $1/lib/$TYPE From 06e5a20cd72e317493680a1d6dd9f0c06d2d0ebd Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 28 Jul 2014 22:42:14 -0500 Subject: [PATCH 09/34] Update poco formula. (cherry picked from commit acbf977583370a86219b1c00233516a1e02eee20) --- scripts/apothecary/formulas/poco.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 644a97c9438..49c7a26b7dd 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -185,17 +185,24 @@ function build() { } # executed inside the lib src dir, first arg $1 is the dest libs dir root -function copy() { +function c/opy() { # headers - mkdir -p $1/include/CppUnit - cp -Rv CppUnit/include/CppUnit/* $1/include/CppUnit + #mkdir -p $1/include/CppUnit + #cp -Rv CppUnit/include/CppUnit/* $1/include/CppUnit mkdir -p $1/include/Poco - cp -Rv Foundation/include/Poco/* $1/include/Poco + cp -Rv Crypto/include/Poco/Crypto $1/include/Poco - cp -Rv Data/include/Poco/Data $1/include/Poco + cp -Rv CppParser/include/Poco/CppParser $1/include/Poco + cp -Rv Data/include/Poco/Data/ $1/include/Poco + cp -Rv Data/include/Poco/Data/SQLite $1/include/Poco/Data + cp -Rv Foundation/include/Poco/* $1/include/Poco + cp -Rv JSON/include/Poco/JSON $1/include/Poco + cp -Rv MongoDB/include/Poco/MongoDB $1/include/Poco cp -Rv Net/include/Poco/Net $1/include/Poco cp -Rv NetSSL_OpenSSL/include/Poco/Net/* $1/include/Poco/Net + cp -Rv PDF/include/Poco/PDF $1/include/Poco + cp -Rv SevenZip/include/Poco/SevenZip $1/include/Poco cp -Rv Util/include/Poco/Util $1/include/Poco cp -Rv XML/include/Poco/* $1/include/Poco cp -Rv Zip/include/Poco/Zip $1/include/Poco From e7c9e2ca0d55fa95439be6de223ccd9dc59f334c Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 28 Jul 2014 22:49:46 -0500 Subject: [PATCH 10/34] Fixed typo in poco.sh (cherry picked from commit 74119f903cea804af7a0742ee9840ae1565c8f59) --- scripts/apothecary/formulas/poco.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 49c7a26b7dd..cc0e89b8ee3 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -185,7 +185,7 @@ function build() { } # executed inside the lib src dir, first arg $1 is the dest libs dir root -function c/opy() { +function copy() { # headers #mkdir -p $1/include/CppUnit From fcbdbae6600a26b08acb2406c7eae9c55398d679 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 28 Jul 2014 22:54:26 -0500 Subject: [PATCH 11/34] Fixed copying error in poco.sh. (cherry picked from commit 00678247349d0f393e7969167ce68e950f7c2bf1) --- scripts/apothecary/formulas/poco.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index cc0e89b8ee3..4ec9fcba9cc 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -188,14 +188,11 @@ function build() { function copy() { # headers - #mkdir -p $1/include/CppUnit - #cp -Rv CppUnit/include/CppUnit/* $1/include/CppUnit mkdir -p $1/include/Poco - cp -Rv Crypto/include/Poco/Crypto $1/include/Poco cp -Rv CppParser/include/Poco/CppParser $1/include/Poco cp -Rv Data/include/Poco/Data/ $1/include/Poco - cp -Rv Data/include/Poco/Data/SQLite $1/include/Poco/Data + cp -Rv Data/SQLite/include/Poco/Data/SQLite $1/include/Poco/Data cp -Rv Foundation/include/Poco/* $1/include/Poco cp -Rv JSON/include/Poco/JSON $1/include/Poco cp -Rv MongoDB/include/Poco/MongoDB $1/include/Poco From cd443b76b04a0dd4f1bc142e10f0ed06b111d1cb Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 29 Jul 2014 11:47:06 -0500 Subject: [PATCH 12/34] Apothecary fixes for 32 bit linux that reports i686. (cherry picked from commit 416853044602adf9d649498db4ae0dafff98fbe1) --- scripts/apothecary/formulas/poco.sh | 4 ++-- scripts/apothecary/ostype.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 4ec9fcba9cc..fb7bbea2472 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -160,7 +160,7 @@ function build() { ./configure $BUILD_OPTS make # delete debug builds - rm lib/Linux/i386/*d.a + rm lib/Linux/$(uname -m)/*d.a elif [ "$TYPE" == "linux64" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" ./configure $BUILD_OPTS @@ -223,7 +223,7 @@ function copy() { cp -v lib/Debug/*.lib $1/lib/$TYPE elif [ "$TYPE" == "linux" ] ; then mkdir -p $1/lib/$TYPE - cp -v lib/Linux/i386/*.a $1/lib/$TYPE + cp -v lib/Linux/$(uname -m)/*.a $1/lib/$TYPE elif [ "$TYPE" == "linux64" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Linux/x86_64/*.a $1/lib/$TYPE diff --git a/scripts/apothecary/ostype.sh b/scripts/apothecary/ostype.sh index f5efceba301..ee4b2b88f21 100755 --- a/scripts/apothecary/ostype.sh +++ b/scripts/apothecary/ostype.sh @@ -12,9 +12,9 @@ if [ "$OS" == "darwin" ]; then elif [ "$OS" == "windowsnt" -o "${OS:0:5}" == "mingw" ] ; then OS="windows" elif [ "$OS" == "linux" ]; then - ARCH=`uname -m` - if [ "$ARCH" == "i386" ] ; then - OS="linux" + ARCH=`uname -m` + if [ "$ARCH" == "i386" -o "$ARCH" == "i686" ] ; then + OS="linux" elif [ "$ARCH" == "x86_64" ] ; then OS="linux64" elif [ "$ARCH" == "armv6l" ] ; then From 3f2cfdb6634dc89a90d54d46ceca15be7c919e2b Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 29 Jul 2014 11:58:01 -0500 Subject: [PATCH 13/34] Apothecary: Poco recipe updates for osx. (cherry picked from commit 45c819e492e800a098acc02c0bc7d43baffb8d3e) --- scripts/apothecary/formulas/poco.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index fb7bbea2472..8d3d0db5c8e 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -14,6 +14,11 @@ VER=1.5.3-release GIT_URL=https://github.com/pocoproject/poco GIT_TAG=poco-$VER +# For Poco Builds, we omit both Data/MySQL and Data/ODBC because they require +# 3rd Party libraries. See https://github.com/pocoproject/poco/blob/develop/README +# for more information. + + # @tgfrerer: we need more fine-grained control over poco source code versions, # which is why we specify the specific poco source code commit we want to use - # When updating poco/this recipe, make sure to specify the proper hash here, @@ -52,7 +57,8 @@ function prepare() { function build() { if [ "$TYPE" == "osx" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. + local BUILD_OPTS="--cflags=-stdlib=libstdc++ --no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" # 32 bit ./configure $BUILD_OPTS --config=Darwin32 From 5b9991933ffddec5459b1b9b0c256227cf505cfb Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 11 Aug 2014 12:26:58 -0500 Subject: [PATCH 14/34] Update poco formula for 32 libstdc++ /64 libc++ config. (cherry picked from commit 119f5f2ffcbefface9bacb203c37598f786df39e) --- scripts/apothecary/formulas/poco.sh | 40 +++++------------------------ 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco.sh index 8d3d0db5c8e..0867988ca14 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco.sh @@ -57,21 +57,22 @@ function prepare() { function build() { if [ "$TYPE" == "osx" ] ; then - # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. - local BUILD_OPTS="--cflags=-stdlib=libstdc++ --no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" # 32 bit - ./configure $BUILD_OPTS --config=Darwin32 + # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. + ./configure $BUILD_OPTS --cflags=-stdlib=libstdc++ --config=Darwin32 make # 64 bit - ./configure $BUILD_OPTS --config=Darwin64 + ./configure $BUILD_OPTS --config=Darwin64-clang-libc++ make cd lib/Darwin # delete debug builds - rm i386/*d.a x86_64/*d.a + rm i386/*d.a + rm x86_64/*d.a # link into universal lib, strip "lib" from filename local lib @@ -82,31 +83,6 @@ function build() { fi done - elif [ "$TYPE" == "osx-clang-libc++" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" - - # @tgfrerer: osx libraries in openFrameworks/master are currently "lean" 32 bit libraries. - # so we omit the 64 bit compilation target for now. - - # 32 bit - ./configure $BUILD_OPTS --config=Darwin32-clang-libc++ - make - - cd lib/Darwin - - # delete debug builds - rm i386/*d.a - - # link into universal lib, strip "lib" from filename - local lib - for lib in $( ls -1 i386) ; do - local renamedLib=$(echo $lib | sed 's|lib||') - if [ ! -e $renamedLib ] ; then - #lipo -c i386/$lib x86_64/$lib -o $renamedLib - libtool -static -o $renamedLib i386/$lib - fi - done - elif [ "$TYPE" == "vs" ] ; then #cmd.exe /c "buildwin.cmd "$VS_VER" build all both Win32 nosamples devenv" ## OR @@ -215,10 +191,6 @@ function copy() { mkdir -p $1/lib/$TYPE cp -v lib/Darwin/*.a $1/lib/$TYPE - elif [ "$TYPE" == "osx-clang-libc++" ] ; then - mkdir -p $1/lib/$TYPE - cp -v lib/Darwin/*.a $1/lib/$TYPE - elif [ "$TYPE" == "ios" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/iPhoneOS/*.a $1/lib/$TYPE From a2b034e223951ebb6f9b006ad41ca388d2027704 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 19 Aug 2014 21:55:16 -0500 Subject: [PATCH 15/34] Incremental updates for poco formula. (cherry picked from commit da503df62202103dad99051fb2dfbb487cfe1d52) --- .../apothecary/formulas/poco/components.patch | 22 ++++++ .../apothecary/formulas/{ => poco}/poco.sh | 68 ++++++++++++++----- 2 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 scripts/apothecary/formulas/poco/components.patch rename scripts/apothecary/formulas/{ => poco}/poco.sh (65%) diff --git a/scripts/apothecary/formulas/poco/components.patch b/scripts/apothecary/formulas/poco/components.patch new file mode 100644 index 00000000000..d5f6736f998 --- /dev/null +++ b/scripts/apothecary/formulas/poco/components.patch @@ -0,0 +1,22 @@ +--- components Mon Aug 18 21:40:47 2014 ++++ components Mon Aug 18 21:39:51 2014 +@@ -1,5 +1,3 @@ +-CppUnit +-CppUnit/WinTestRunner + Foundation + XML + JSON +@@ -9,13 +7,6 @@ + NetSSL_OpenSSL + Data + Data/SQLite +-Data/ODBC +-Data/MySQL + Zip +-PageCompiler +-PageCompiler/File2Page + PDF +-CppParser + MongoDB +-PocoDoc +-ProGen diff --git a/scripts/apothecary/formulas/poco.sh b/scripts/apothecary/formulas/poco/poco.sh similarity index 65% rename from scripts/apothecary/formulas/poco.sh rename to scripts/apothecary/formulas/poco/poco.sh index 0867988ca14..ddb00224f70 100644 --- a/scripts/apothecary/formulas/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -50,14 +50,43 @@ function prepare() { cd build/config cp iPhone iPhone.orig cp iPhoneSimulator iPhoneSimulator.orig + elif [ "$TYPE" == "vs" ] ; then + # Patch the components to exclude those that we aren't using. + if patch -p0 -u -N --dry-run --silent < $FORMULA_DIR/components.patch 2>/dev/null ; then + patch -p0 -u < $FORMULA_DIR/components.patch + fi + + # Locate the path of the openssl libs distributed with openFrameworks. + local OF_LIBS_OPENSSL="../../../../libs/openssl/" + + # get the absolute path to the included openssl libs + local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) + + # convert the absolute path from unix to windows + local OPENSSL_DIR=$(echo $OF_LIBS_OPENSSL_ABS_PATH | sed 's/^\///' | sed 's/\//\\/g' | sed 's/^./\0:/') + + # escape windows slashes and a few common escape sequences before passing to sed + local OPENSSL_DIR=$(echo $OPENSSL_DIR | sed 's/\\/\\\\\\/g' | sed 's/\\\U/\\\\U/g' | sed 's/\\\l/\\\\l/g') + + # replace OPENSSL_DIR=C:\OpenSSL with our OPENSSL_DIR + sed -i.tmp "s|C:\\\OpenSSL|$OPENSSL_DIR|g" buildwin.cmd + + # replace OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC with OPENSSL_LIB=%OPENSSL_DIR%\lib\vs + sed -i.tmp "s|%OPENSSL_DIR%\\\lib;.*|%OPENSSL_DIR%\\\lib\\\vs|g" buildwin.cmd + + elif [ "$TYPE" == "win_cb" ] ; then + # Use the mingw equivalent of mc to compile the pocomsg.mc file into a pocomsg.h. + cd Foundation/src + windmc pocomsg.mc fi + } # executed inside the lib src dir function build() { if [ "$TYPE" == "osx" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" # 32 bit # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. @@ -84,16 +113,25 @@ function build() { done elif [ "$TYPE" == "vs" ] ; then - #cmd.exe /c "buildwin.cmd "$VS_VER" build all both Win32 nosamples devenv" - ## OR - cmake -G "Visual Studio $VS_VER" -DPOCO_STATIC="1" -DCMAKE_DEBUG_POSTFIX="mdd" -DCMAKE_RELEASE_POSTFIX="md" - vs-build "Poco.sln" Build Debug - vs-build "Poco.sln" Build Release - + cmd //c buildwin.cmd ${VS_VER}0 build static_md both Win32 nosamples notests + + elif [ "$TYPE" == "win_cb" ] ; then + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + + local OPENSSL_INCLUDE="/c/Users/bakercp/openFrameworks/libs/openssl/include" + local OPENSSL_LIBS="/c/Users/bakercp/openFrameworks/libs/openssl/lib/win_cb" + + ./configure $BUILD_OPTS \ + --cflags="-D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -O3 -std=c++11 -DPOCO_ENABLE_CPP11 -DPOCO_NO_SOO -DPOCO_NO_AUTOMATIC_LIB_INIT" \ + --include-path=$OPENSSL_INCLUDE \ + --library-path=$OPENSSL_LIBS \ + --config=MinGW + make + elif [ "$TYPE" == "ios" ] ; then # maybe --poquito is a good idea? - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC,NetSSL_OpenSSL,Crypto" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen,NetSSL_OpenSSL,Crypto" cp build/config/iPhone.orig build/config/iPhone cp build/config/iPhoneSimulator.orig build/config/iPhoneSimulator @@ -138,25 +176,25 @@ function build() { echoWarning "TODO: android build" elif [ "$TYPE" == "linux" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/$(uname -m)/*d.a elif [ "$TYPE" == "linux64" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/x86_64/*d.a elif [ "$TYPE" == "linuxarmv6l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/armv6l/*d.a elif [ "$TYPE" == "linuxarmv7l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=Data/MySQL,Data/ODBC" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds @@ -174,7 +212,7 @@ function copy() { cp -Rv Crypto/include/Poco/Crypto $1/include/Poco cp -Rv CppParser/include/Poco/CppParser $1/include/Poco cp -Rv Data/include/Poco/Data/ $1/include/Poco - cp -Rv Data/SQLite/include/Poco/Data/SQLite $1/include/Poco/Data + cp -Rv Data/SQLite/include/Poco/Data/SQLite $1/include/Poco/Data/SQLite cp -Rv Foundation/include/Poco/* $1/include/Poco cp -Rv JSON/include/Poco/JSON $1/include/Poco cp -Rv MongoDB/include/Poco/MongoDB $1/include/Poco @@ -220,11 +258,9 @@ function copy() { function clean() { if [ "$TYPE" == "vs" ] ; then - echoWarning "TODO: clean vs" - + cmd //c buildwin.cmd ${VS_VER}0 clean static_md both Win32 nosamples notests elif [ "$TYPE" == "android" ] ; then echoWarning "TODO: clean android" - else make clean fi From dc7ac98db69895a280ad02ac56740831ff346294 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 19 Aug 2014 22:26:15 -0500 Subject: [PATCH 16/34] Fix copy stage for poco recipe. (cherry picked from commit 91aa40b4ed7ea75c77255e7920ddaf56efe931a4) --- scripts/apothecary/formulas/poco/poco.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index ddb00224f70..7c8ed299df0 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -208,11 +208,10 @@ function build() { function copy() { # headers - mkdir -p $1/include/Poco + mkdir -pv $1/include/Poco cp -Rv Crypto/include/Poco/Crypto $1/include/Poco - cp -Rv CppParser/include/Poco/CppParser $1/include/Poco - cp -Rv Data/include/Poco/Data/ $1/include/Poco - cp -Rv Data/SQLite/include/Poco/Data/SQLite $1/include/Poco/Data/SQLite + cp -Rv Data/include/Poco/Data $1/include/Poco + cp -Rv Data/SQLite/include/Poco/Data $1/include/Poco cp -Rv Foundation/include/Poco/* $1/include/Poco cp -Rv JSON/include/Poco/JSON $1/include/Poco cp -Rv MongoDB/include/Poco/MongoDB $1/include/Poco From 34984d65c053f50471659d27b4d79d900d7cbf62 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 19 Aug 2014 23:50:55 -0500 Subject: [PATCH 17/34] Update copy stage for poco VS forumula. (cherry picked from commit a5398de086c69e6b4748d5b3402c5ba9bd99e7d5) --- scripts/apothecary/formulas/poco/poco.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 7c8ed299df0..707cdd89bb9 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -227,15 +227,12 @@ function copy() { if [ "$TYPE" == "osx" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Darwin/*.a $1/lib/$TYPE - elif [ "$TYPE" == "ios" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/iPhoneOS/*.a $1/lib/$TYPE - elif [ "$TYPE" == "vs" ] ; then mkdir -p $1/lib/$TYPE - cp -v lib/Release/*.lib $1/lib/$TYPE - cp -v lib/Debug/*.lib $1/lib/$TYPE + cp -v lib/*.lib $1/lib/$TYPE elif [ "$TYPE" == "linux" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Linux/$(uname -m)/*.a $1/lib/$TYPE From a1827e5f1af192bc2837dbb4ee82acc75b7a40ef Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 12:14:36 -0500 Subject: [PATCH 18/34] Merge: Incremental update for poco forumula on win_cb. https://github.com/bakercp/openFrameworks/commit/b6bffc10fcfe3b23692f5c8 536838573ceba1b13 (cherry picked from commit 13b9d5a311b313bfd670b9d98cc9e8703baa1d6a) --- scripts/apothecary/formulas/poco/poco.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 707cdd89bb9..9c1ab85fe09 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -11,7 +11,7 @@ VER=1.5.3-release # tools for git use -GIT_URL=https://github.com/pocoproject/poco +GIT_URL=https://github.com/bakercp/poco GIT_TAG=poco-$VER # For Poco Builds, we omit both Data/MySQL and Data/ODBC because they require @@ -121,11 +121,13 @@ function build() { local OPENSSL_INCLUDE="/c/Users/bakercp/openFrameworks/libs/openssl/include" local OPENSSL_LIBS="/c/Users/bakercp/openFrameworks/libs/openssl/lib/win_cb" + # we must include -std=c++11 with CFLAGS, which is not compatible with c, but we can handle the warnings. + ./configure $BUILD_OPTS \ - --cflags="-D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -O3 -std=c++11 -DPOCO_ENABLE_CPP11 -DPOCO_NO_SOO -DPOCO_NO_AUTOMATIC_LIB_INIT" \ --include-path=$OPENSSL_INCLUDE \ --library-path=$OPENSSL_LIBS \ --config=MinGW + make elif [ "$TYPE" == "ios" ] ; then @@ -233,6 +235,9 @@ function copy() { elif [ "$TYPE" == "vs" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/*.lib $1/lib/$TYPE + elif [ "$TYPE" == "win_cb" ] ; then + mkdir -p $1/lib/$TYPE + cp -v lib/MinGW/$(uname -m)/*.a $1/lib/$TYPE elif [ "$TYPE" == "linux" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Linux/$(uname -m)/*.a $1/lib/$TYPE From 2f808785b8b0778de70fbd8f3f7dbf0657d16356 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 18:16:05 -0500 Subject: [PATCH 19/34] Message compilation is now handled by Poco. (cherry picked from commit e18df94e12f02373a5bcf8c8510cbc7c7eb43013) --- scripts/apothecary/formulas/poco/poco.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 9c1ab85fe09..b0e2143209e 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -74,10 +74,6 @@ function prepare() { # replace OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC with OPENSSL_LIB=%OPENSSL_DIR%\lib\vs sed -i.tmp "s|%OPENSSL_DIR%\\\lib;.*|%OPENSSL_DIR%\\\lib\\\vs|g" buildwin.cmd - elif [ "$TYPE" == "win_cb" ] ; then - # Use the mingw equivalent of mc to compile the pocomsg.mc file into a pocomsg.h. - cd Foundation/src - windmc pocomsg.mc fi } From 4821baf8eb6dd64563b34585bb6fc56b2da41018 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 18:31:24 -0500 Subject: [PATCH 20/34] Update poco custom release location. (cherry picked from commit f49a7450d7288eeb7d8f8892d9c7af69d006866b) --- scripts/apothecary/formulas/poco/poco.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index b0e2143209e..aa104ba88b6 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=1.5.3-release +VER=apothecary-1.0 # tools for git use GIT_URL=https://github.com/bakercp/poco From 3a0261fe95311d960136b1371fc9cf08843583aa Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 19:24:45 -0500 Subject: [PATCH 21/34] Clean up poco recipe. (cherry picked from commit 00caee9cf3fb6e795e9a60146388ade0b65f268a) --- scripts/apothecary/formulas/poco/poco.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index aa104ba88b6..3c8f5e96055 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -117,8 +117,6 @@ function build() { local OPENSSL_INCLUDE="/c/Users/bakercp/openFrameworks/libs/openssl/include" local OPENSSL_LIBS="/c/Users/bakercp/openFrameworks/libs/openssl/lib/win_cb" - # we must include -std=c++11 with CFLAGS, which is not compatible with c, but we can handle the warnings. - ./configure $BUILD_OPTS \ --include-path=$OPENSSL_INCLUDE \ --library-path=$OPENSSL_LIBS \ @@ -126,6 +124,9 @@ function build() { make + # Delete debug libs. + lib/MinGW/i686/*d.a + elif [ "$TYPE" == "ios" ] ; then # maybe --poquito is a good idea? @@ -233,7 +234,7 @@ function copy() { cp -v lib/*.lib $1/lib/$TYPE elif [ "$TYPE" == "win_cb" ] ; then mkdir -p $1/lib/$TYPE - cp -v lib/MinGW/$(uname -m)/*.a $1/lib/$TYPE + cp -v lib/MinGW/i686/*.a $1/lib/$TYPE elif [ "$TYPE" == "linux" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Linux/$(uname -m)/*.a $1/lib/$TYPE From 1bbce26c323abe81314e053e6e21ff80b4e44042 Mon Sep 17 00:00:00 2001 From: Daniel Rosser Date: Fri, 22 Aug 2014 20:16:27 +1000 Subject: [PATCH 22/34] Apothecary: Poco Formula iOS (armv7, armv7s, arm64, i386, x86_64) - Adds formula for iOS compile for Poco for all targeted architectures. Requires fix for Poco for arm64 : https://github.com/pocoproject/poco/pull/523 @bakercp you will need to add this to your apothecary tag :D! (cherry picked from commit 6023a198b5609ad52bf9e672e6db89c3183e9526) --- scripts/apothecary/formulas/poco/poco.sh | 107 ++++++++++++++++++----- 1 file changed, 83 insertions(+), 24 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 3c8f5e96055..e1f978fe456 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -47,9 +47,11 @@ function prepare() { # make backups of the ios config files since we need to edit them if [ "$TYPE" == "ios" ] ; then + mkdir -p lib/$TYPE cd build/config - cp iPhone iPhone.orig - cp iPhoneSimulator iPhoneSimulator.orig + cp iPhoneSimulator-clang-libc++ iPhoneSimulator-clang-libc++.orig + # fix using sed i636 reference and allow overloading variable + sed -i .tmp "s|POCO_TARGET_OSARCH.* = .*|POCO_TARGET_OSARCH ?= i386|" iPhoneSimulator-clang-libc++ elif [ "$TYPE" == "vs" ] ; then # Patch the components to exclude those that we aren't using. if patch -p0 -u -N --dry-run --silent < $FORMULA_DIR/components.patch 2>/dev/null ; then @@ -73,7 +75,6 @@ function prepare() { # replace OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC with OPENSSL_LIB=%OPENSSL_DIR%\lib\vs sed -i.tmp "s|%OPENSSL_DIR%\\\lib;.*|%OPENSSL_DIR%\\\lib\\\vs|g" buildwin.cmd - fi } @@ -130,44 +131,102 @@ function build() { elif [ "$TYPE" == "ios" ] ; then # maybe --poquito is a good idea? - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen,NetSSL_OpenSSL,Crypto" - cp build/config/iPhone.orig build/config/iPhone - cp build/config/iPhoneSimulator.orig build/config/iPhoneSimulator + local BUILD_POCO_CONFIG_IPHONE=iPhone-clang-libc++ + local BUILD_POCO_CONFIG_SIMULATOR=iPhoneSimulator-clang-libc++ - # set SDK - sed -i .tmp "s|#.*IPHONE_SDK_VERSION =.*|IPHONE_SDK_VERSION = $IOS_SDK_VER|" build/config/iPhone + # Locate the path of the openssl libs distributed with openFrameworks. + local OF_LIBS_OPENSSL="../../../../libs/openssl/" + + # get the absolute path to the included openssl libs + local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) + + local OPENSSL_INCLUDE=$OF_LIBS_OPENSSL_ABS_PATH/include + local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ios - # fix any xcode path issues (currently fixed in newer poco, done here manually for now) - sed -i .tmp 's|= /Developer|= $(shell xcode-select -print-path)|' build/config/iPhone - sed -i .tmp 's|= /Developer|= $(shell xcode-select -print-path)|' build/config/iPhoneSimulator + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen --include-path=$OPENSSL_INCLUDE --library-path=$OPENSSL_LIBS" + local TOOLCHAIN=$XCODE_DEV_ROOT/Toolchains/XcodeDefault.xctoolchain + + export IPHONE_SDK="iPhoneOS" + local IOS_DEVROOT=$XCODE_DEV_ROOT/Platforms/$IPHONE_SDK.platform/Developer + export IPHONE_SDK_ROOT=$IOS_DEVROOT/SDKs + + # armv7 + export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER + export POCO_TARGET_OSARCH="armv7" - # armv7 - sed -i .tmp "s|POCO_TARGET_OSARCH.*?=.*|POCO_TARGET_OSARCH ?= armv7|" build/config/iPhone - ./configure $BUILD_OPTS --config=iPhone + # configure and make + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE make + # remove debug builds + rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a + + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN # armv7s - sed -i .tmp "s|POCO_TARGET_OSARCH.*?=.*|POCO_TARGET_OSARCH ?= armv7s|" build/config/iPhone - ./configure $BUILD_OPTS --config=iPhone + export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER + export POCO_TARGET_OSARCH="armv7s" + + # configure and make + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE make + # remove debug builds + rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a + + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN + + # arm64 + local IPHONE_SDK_VERSION_64_MIN="7.0" # arm64 min is iOS 7.0 + export IPHONE_SDK_VERSION_MIN=$IPHONE_SDK_VERSION_64_MIN + export POCO_TARGET_OSARCH="arm64" - # simulator - sed -i .tmp "s|POCO_TARGET_OSARCH.* = .*|POCO_TARGET_OSARCH = i386|" build/config/iPhoneSimulator - ./configure $BUILD_OPTS --config=iPhoneSimulator + # configure and make + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE make + # remove debug builds + rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - cd lib/iPhoneOS + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN + + unset IPHONE_SDK IPHONE_SDK_ROOT - # delete debug builds - rm armv7/*d.a armv7s/*d.a ../iPhoneSimulator/i386/*d.a + export IPHONE_SDK="iPhoneSimulator" + local IOS_DEVROOT=$XCODE_DEV_ROOT/Platforms/$IPHONE_SDK.platform/Developer + export IPHONE_SDK_ROOT=$IOS_DEVROOT/SDKs + + # i386 simulator + export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER + export POCO_TARGET_OSARCH="i386" + + # configure and make + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_SIMULATOR + make + # remove debug builds + rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a + + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN + + # x86_64 simulator + export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER + export POCO_TARGET_OSARCH="x86_64" + + # configure and make + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_SIMULATOR + make + # remove debug builds + rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a + + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN + + unset IPHONE_SDK IPHONE_SDK_ROOT + cd lib/$TYPE # link into universal lib, strip "lib" from filename local lib for lib in $( ls -1 ../iPhoneSimulator/i386) ; do local renamedLib=$(echo $lib | sed 's|lib||') if [ ! -e $renamedLib ] ; then - lipo -c armv7/$lib armv7s/$lib ../iPhoneSimulator/i386/$lib -o $renamedLib + lipo -c ../iPhoneOS/armv7/$lib ../iPhoneOS/armv7s/$lib ../iPhoneOS/arm64/$lib ../iPhoneSimulator/i386/$lib ../iPhoneSimulator/x86_64/$lib -o $renamedLib fi done @@ -228,7 +287,7 @@ function copy() { cp -v lib/Darwin/*.a $1/lib/$TYPE elif [ "$TYPE" == "ios" ] ; then mkdir -p $1/lib/$TYPE - cp -v lib/iPhoneOS/*.a $1/lib/$TYPE + cp -v lib/$TYPE/*.a $1/lib/$TYPE elif [ "$TYPE" == "vs" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/*.lib $1/lib/$TYPE From 5df7d7a649c8d28b15c7b1403198d0e210a9240b Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Fri, 22 Aug 2014 10:08:37 -0500 Subject: [PATCH 23/34] Update to latest Poco tag. This change does not require a rebuild of existing static libs. (cherry picked from commit ff847898e210a2e547fb2086a93e3a77e15190dd) --- scripts/apothecary/formulas/poco/poco.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index e1f978fe456..80be4a1110c 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=apothecary-1.0 +VER=apothecary-1.1 # tools for git use GIT_URL=https://github.com/bakercp/poco From 83bc3a79d46f683adcb40f0208b9ad6139f11b6f Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Sat, 23 Aug 2014 22:44:26 -0500 Subject: [PATCH 24/34] Cleanup. (cherry picked from commit 4ce571fa32735fea45fcbb72de3ddda228e8ca69) --- scripts/apothecary/formulas/poco/poco.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 80be4a1110c..7e6102ce0c0 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -18,13 +18,6 @@ GIT_TAG=poco-$VER # 3rd Party libraries. See https://github.com/pocoproject/poco/blob/develop/README # for more information. - -# @tgfrerer: we need more fine-grained control over poco source code versions, -# which is why we specify the specific poco source code commit we want to use - -# When updating poco/this recipe, make sure to specify the proper hash here, -# and check if the header patches still apply cleanly. - -# @TODO: New commit ref? SHA= # download the source code and unpack it into LIB_NAME From 222701e39b80e92d750a030c6a588b71143fffb2 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Sun, 24 Aug 2014 01:39:24 -0500 Subject: [PATCH 25/34] Update apothecary script to include android. (cherry picked from commit 6b0e53e5a6ce5a1cb6a934c2a7fb35546e865916) --- scripts/apothecary/formulas/poco/poco.sh | 64 ++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 7e6102ce0c0..e374d9c5138 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=apothecary-1.1 +VER=apothecary-1.4 # tools for git use GIT_URL=https://github.com/bakercp/poco @@ -68,6 +68,8 @@ function prepare() { # replace OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC with OPENSSL_LIB=%OPENSSL_DIR%\lib\vs sed -i.tmp "s|%OPENSSL_DIR%\\\lib;.*|%OPENSSL_DIR%\\\lib\\\vs|g" buildwin.cmd + elif [ "$TYPE" == "android" ] ; then + installAndroidToolchain fi } @@ -224,7 +226,50 @@ function build() { done elif [ "$TYPE" == "android" ] ; then - echoWarning "TODO: android build" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + + local OLD_PATH=$PATH + + export PATH=$PATH:$BUILD_DIR/Toolchains/Android/androideabi/bin:$BUILD_DIR/Toolchains/Android/x86/bin + + local OF_LIBS_OPENSSL="../../../../libs/openssl/" + + # get the absolute path to the included openssl libs + local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) + + local OPENSSL_INCLUDE=$OF_LIBS_OPENSSL_ABS_PATH/include + local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ + + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + + ./configure $BUILD_OPTS \ + --include-path=$OPENSSL_INCLUDE \ + --library-path=$OPENSSL_LIBS/armeabi \ + --config=Android + + make ANDROID_ABI=armeabi + + ./configure $BUILD_OPTS \ + --include-path=$OPENSSL_INCLUDE \ + --library-path=$OPENSSL_LIBS/armeabi-v7a \ + --config=Android + + make ANDROID_ABI=armeabi-v7a + + ./configure $BUILD_OPTS \ + --include-path=$OPENSSL_INCLUDE \ + --library-path=$OPENSSL_LIBS/x86 \ + --config=Android + + make ANDROID_ABI=x86 + + echo `pwd` + + rm -v lib/Android/armeabi/*d.a + rm -v lib/Android/armeabi-v7a/*d.a + rm -v lib/Android/x86/*d.a + + export PATH=$OLD_PATH elif [ "$TYPE" == "linux" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" @@ -299,6 +344,15 @@ function copy() { elif [ "$TYPE" == "linuxarmv7l" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Linux/armv7l/*.a $1/lib/$TYPE + elif [ "$TYPE" == "android" ] ; then + mkdir -p $1/lib/$TYPE/armeabi + cp -v lib/Android/armeabi/*.a $1/lib/$TYPE/armeabi + + mkdir -p $1/lib/$TYPE/armeabi-v7a + cp -v lib/Android/armeabi-v7a/*.a $1/lib/$TYPE/armeabi-v7a + + mkdir -p $1/lib/$TYPE/x86 + cp -v lib/Android/x86/*.a $1/lib/$TYPE/x86 else echoWarning "TODO: copy $TYPE lib" fi @@ -310,7 +364,11 @@ function clean() { if [ "$TYPE" == "vs" ] ; then cmd //c buildwin.cmd ${VS_VER}0 clean static_md both Win32 nosamples notests elif [ "$TYPE" == "android" ] ; then - echoWarning "TODO: clean android" + export PATH=$PATH:$ANDROID_TOOLCHAIN_ANDROIDEABI/bin:$ANDROID_TOOLCHAIN_X86/bin + make clean ANDROID_ABI=armeabi + make clean ANDROID_ABI=armeabi-v7a + make clean ANDROID_ABI=x86 + unset PATH else make clean fi From 5374da44aa5999cac1354dcab0beb94a659a38b4 Mon Sep 17 00:00:00 2001 From: Daniel Rosser Date: Mon, 29 Sep 2014 11:32:47 +1000 Subject: [PATCH 26/34] Apothecary: Poco Formula updated for iOS (armv7, armv7s, arm64, i386, (cherry picked from commit d8ad6aeaf10b6928b6c0838b6214a8cb97f7c67e) --- scripts/apothecary/formulas/poco/poco.sh | 238 +++++++++++++++-------- 1 file changed, 162 insertions(+), 76 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index e374d9c5138..7e5550ae897 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -23,11 +23,13 @@ SHA= # download the source code and unpack it into LIB_NAME function download() { if [ "$SHA" == "" ] ; then + echo "SHA=="" $GIT_URL" curl -Lk $GIT_URL/archive/$GIT_TAG.tar.gz -o poco-$GIT_TAG.tar.gz tar -xf poco-$GIT_TAG.tar.gz mv poco-$GIT_TAG poco rm poco*.tar.gz else + echo $GIT_URL git clone $GIT_URL -b poco-$VER fi } @@ -41,10 +43,28 @@ function prepare() { # make backups of the ios config files since we need to edit them if [ "$TYPE" == "ios" ] ; then mkdir -p lib/$TYPE + mkdir -p lib/iPhoneOS + cd build/config + cp iPhoneSimulator-clang-libc++ iPhoneSimulator-clang-libc++.orig + cp iPhone-clang-libc++ iPhone-clang-libc++.orig + # fix using sed i636 reference and allow overloading variable sed -i .tmp "s|POCO_TARGET_OSARCH.* = .*|POCO_TARGET_OSARCH ?= i386|" iPhoneSimulator-clang-libc++ + sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhoneSimulator-clang-libc++ + sed -i .tmp "s|STATICOPT_CC =|STATICOPT_CC ?= -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|STATICOPT_CXX =|STATICOPT_CXX ?= -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CC = -DNDEBUG -O2|RELEASEOPT_CC = -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CXX = -DNDEBUG -O |RELEASEOPT_CXX = -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + + cd ../rules/ + cp compile compile.orig + # Fix for making debug and release, making just release + sed -i .tmp "s|all_static: static_debug static_release|all_static: static_release|" compile + cd ../../ + elif [ "$TYPE" == "vs" ] ; then # Patch the components to exclude those that we aren't using. if patch -p0 -u -N --dry-run --silent < $FORMULA_DIR/components.patch 2>/dev/null ; then @@ -125,7 +145,37 @@ function build() { elif [ "$TYPE" == "ios" ] ; then - # maybe --poquito is a good idea? + + SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version` + set -e + CURRENTPATH=`pwd` + + DEVELOPER=$XCODE_DEV_ROOT + TOOLCHAIN=${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain + VERSION=$VER + + local IOS_ARCHS="i386 x86_64 armv7 armv7s arm64" + echo "--------------------" + echo $CURRENTPATH + + # Validate environment + case $XCODE_DEV_ROOT in + *\ * ) + echo "Your Xcode path contains whitespaces, which is not supported." + exit 1 + ;; + esac + case $CURRENTPATH in + *\ * ) + echo "Your path contains whitespaces, which is not supported by 'make install'." + exit 1 + ;; + esac + + echo "------------" + # To Fix: global:62: *** Current working directory not under $PROJECT_BASE. Stop. make + echo "Note: For Poco, make sure to call it with lowercase poco name: ./apothecary -t ios update poco" + echo "----------" local BUILD_POCO_CONFIG_IPHONE=iPhone-clang-libc++ local BUILD_POCO_CONFIG_SIMULATOR=iPhoneSimulator-clang-libc++ @@ -140,91 +190,126 @@ function build() { local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ios local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen --include-path=$OPENSSL_INCLUDE --library-path=$OPENSSL_LIBS" - local TOOLCHAIN=$XCODE_DEV_ROOT/Toolchains/XcodeDefault.xctoolchain - - export IPHONE_SDK="iPhoneOS" - local IOS_DEVROOT=$XCODE_DEV_ROOT/Platforms/$IPHONE_SDK.platform/Developer - export IPHONE_SDK_ROOT=$IOS_DEVROOT/SDKs - - # armv7 - export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER - export POCO_TARGET_OSARCH="armv7" - - # configure and make - ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE - make - # remove debug builds - rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN - - # armv7s - export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER - export POCO_TARGET_OSARCH="armv7s" - - # configure and make - ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE - make - # remove debug builds - rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN - - # arm64 - local IPHONE_SDK_VERSION_64_MIN="7.0" # arm64 min is iOS 7.0 - export IPHONE_SDK_VERSION_MIN=$IPHONE_SDK_VERSION_64_MIN - export POCO_TARGET_OSARCH="arm64" - - # configure and make - ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE - make - # remove debug builds - rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN - unset IPHONE_SDK IPHONE_SDK_ROOT - - export IPHONE_SDK="iPhoneSimulator" - local IOS_DEVROOT=$XCODE_DEV_ROOT/Platforms/$IPHONE_SDK.platform/Developer - export IPHONE_SDK_ROOT=$IOS_DEVROOT/SDKs - - # i386 simulator - export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER - export POCO_TARGET_OSARCH="i386" - - # configure and make - ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_SIMULATOR - make - # remove debug builds - rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN - - # x86_64 simulator - export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER - export POCO_TARGET_OSARCH="x86_64" - - # configure and make - ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_SIMULATOR - make - # remove debug builds - rm lib/$IPHONE_SDK/$POCO_TARGET_OSARCH/*d.a - - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN + STATICOPT_CC=-fPIC + STATICOPT_CXX=-fPIC + + # loop through architectures! yay for loops! + for IOS_ARCH in ${IOS_ARCHS} + do + MIN_IOS_VERSION=$IOS_MIN_SDK_VER + # min iOS version for arm64 is iOS 7 + + if [[ "${IOS_ARCH}" == "arm64" || "${IOS_ARCH}" == "x86_64" ]]; then + MIN_IOS_VERSION=7.0 # 7.0 as this is the minimum for these architectures + elif [ "${IOS_ARCH}" == "i386" ]; then + MIN_IOS_VERSION=5.1 # 6.0 to prevent start linking errors + fi + export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER + + export POCO_TARGET_OSARCH=$IOS_ARCH + + MIN_TYPE=-miphoneos-version-min= + if [[ "${IOS_ARCH}" == "i386" || "${IOS_ARCH}" == "x86_64" ]]; + then + PLATFORM="iPhoneSimulator" + BUILD_POCO_CONFIG=$BUILD_POCO_CONFIG_SIMULATOR + MIN_TYPE=-mios-simulator-version-min= + else + PLATFORM="iPhoneOS" + BUILD_POCO_CONFIG=$BUILD_POCO_CONFIG_SIMULATOR + fi - unset IPHONE_SDK IPHONE_SDK_ROOT + export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" + export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk" + export BUILD_TOOLS="${DEVELOPER}" + + mkdir -p "$CURRENTPATH/build/$TYPE/$IOS_ARCH" + LOG="$CURRENTPATH/build/$TYPE/$IOS_ARCH/poco-$IOS_ARCH-${VER}.log" + set +e + + if [[ "${IOS_ARCH}" == "i386" || "${IOS_ARCH}" == "x86_64" ]]; + then + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + else + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + fi + echo "--------------------" + echo "Making Poco-${VER} for ${PLATFORM} ${SDKVERSION} ${IOS_ARCH} : iOS Minimum=$MIN_IOS_VERSION" + echo "--------------------" + echo "Configuring for ${IOS_ARCH} ..." + ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE > "${LOG}" 2>&1 + + if [ $? != 0 ]; then + echo "Problem while configure - Please check ${LOG}" + exit 1 + else + echo "Configure successful" + fi + echo "--------------------" + echo "Running make for ${IOS_ARCH}" + echo "To see status in realtime check:" + echo " ${LOG}" + echo "Please stand by..." + make >> "${LOG}" 2>&1 + if [ $? != 0 ]; + then + echo "Problem while make - Please check ${LOG}" + exit 1 + else + echo "Make Successful for ${IOS_ARCH}" + fi + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN OSFLAGS + unset CROSS_TOP CROSS_SDK BUILD_TOOLS + + echo "--------------------" + + done - cd lib/$TYPE + cd lib/iPhoneOS # link into universal lib, strip "lib" from filename local lib - for lib in $( ls -1 ../iPhoneSimulator/i386) ; do + for lib in $( ls -1 i386) ; do local renamedLib=$(echo $lib | sed 's|lib||') if [ ! -e $renamedLib ] ; then - lipo -c ../iPhoneOS/armv7/$lib ../iPhoneOS/armv7s/$lib ../iPhoneOS/arm64/$lib ../iPhoneSimulator/i386/$lib ../iPhoneSimulator/x86_64/$lib -o $renamedLib + lipo -c armv7/$lib armv7s/$lib arm64/$lib i386/$lib x86_64/$lib -o ../ios/$renamedLib fi done + cd ../../ + + echo "--------------------" + echo "Stripping any lingering symbols" + + cd lib/$TYPE + SLOG="$CURRENTPATH/lib/$TYPE-stripping.log" + local TOBESTRIPPED + for TOBESTRIPPED in $( ls -1) ; do + strip -x $TOBESTRIPPED >> "${SLOG}" 2>&1 + if [ $? != 0 ]; + then + echo "Problem while stripping lib - Please check ${SLOG}" + exit 1 + else + echo "Strip Successful for ${SLOG}" + fi + done + + + cd ../../ + + echo "--------------------" + echo "Reseting changed files back to originals" + cd build/config + cp iPhoneSimulator-clang-libc++.orig iPhoneSimulator-clang-libc++ + cp iPhone-clang-libc++.orig iPhone-clang-libc++ + cd ../rules/ + cp compile.orig compile + cd ../../ + echo "--------------------" + + echo "Completed." + elif [ "$TYPE" == "android" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" @@ -372,4 +457,5 @@ function clean() { else make clean fi + } From a54aaf951a0db5a87ec836defacd5101d7d24f1a Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 6 Oct 2014 10:41:29 -0500 Subject: [PATCH 27/34] Update poco apothecary tag. (cherry picked from commit 46ec710e1d40c29907c30ff3e0cc627191311950) (cherry picked from commit 3e1e66d84dadf349b4af6c0ba295b1f7d0cf7abb) --- scripts/apothecary/formulas/poco/poco.sh | 46 ++++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 7e5550ae897..e05dd06dbf8 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=apothecary-1.4 +VER=apothecary-1.5 # tools for git use GIT_URL=https://github.com/bakercp/poco @@ -66,7 +66,7 @@ function prepare() { cd ../../ elif [ "$TYPE" == "vs" ] ; then - # Patch the components to exclude those that we aren't using. + # Patch the components to exclude those that we aren't using. if patch -p0 -u -N --dry-run --silent < $FORMULA_DIR/components.patch 2>/dev/null ; then patch -p0 -u < $FORMULA_DIR/components.patch fi @@ -99,7 +99,7 @@ function build() { if [ "$TYPE" == "osx" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" - + # 32 bit # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. ./configure $BUILD_OPTS --cflags=-stdlib=libstdc++ --config=Darwin32 @@ -146,10 +146,10 @@ function build() { elif [ "$TYPE" == "ios" ] ; then - SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version` + SDKVERSION=`xcrun -sdk iphoneos --show-sdk-version` set -e CURRENTPATH=`pwd` - + DEVELOPER=$XCODE_DEV_ROOT TOOLCHAIN=${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain VERSION=$VER @@ -159,18 +159,18 @@ function build() { echo $CURRENTPATH # Validate environment - case $XCODE_DEV_ROOT in + case $XCODE_DEV_ROOT in *\ * ) echo "Your Xcode path contains whitespaces, which is not supported." exit 1 ;; esac - case $CURRENTPATH in + case $CURRENTPATH in *\ * ) echo "Your path contains whitespaces, which is not supported by 'make install'." exit 1 ;; - esac + esac echo "------------" # To Fix: global:62: *** Current working directory not under $PROJECT_BASE. Stop. make @@ -190,7 +190,7 @@ function build() { local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ios local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen --include-path=$OPENSSL_INCLUDE --library-path=$OPENSSL_LIBS" - + STATICOPT_CC=-fPIC STATICOPT_CXX=-fPIC @@ -199,14 +199,14 @@ function build() { do MIN_IOS_VERSION=$IOS_MIN_SDK_VER # min iOS version for arm64 is iOS 7 - + if [[ "${IOS_ARCH}" == "arm64" || "${IOS_ARCH}" == "x86_64" ]]; then MIN_IOS_VERSION=7.0 # 7.0 as this is the minimum for these architectures elif [ "${IOS_ARCH}" == "i386" ]; then MIN_IOS_VERSION=5.1 # 6.0 to prevent start linking errors fi export IPHONE_SDK_VERSION_MIN=$IOS_MIN_SDK_VER - + export POCO_TARGET_OSARCH=$IOS_ARCH MIN_TYPE=-miphoneos-version-min= @@ -227,11 +227,11 @@ function build() { mkdir -p "$CURRENTPATH/build/$TYPE/$IOS_ARCH" LOG="$CURRENTPATH/build/$TYPE/$IOS_ARCH/poco-$IOS_ARCH-${VER}.log" set +e - + if [[ "${IOS_ARCH}" == "i386" || "${IOS_ARCH}" == "x86_64" ]]; then export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" - else + else export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" fi echo "--------------------" @@ -240,10 +240,10 @@ function build() { echo "Configuring for ${IOS_ARCH} ..." ./configure $BUILD_OPTS --config=$BUILD_POCO_CONFIG_IPHONE > "${LOG}" 2>&1 - if [ $? != 0 ]; then + if [ $? != 0 ]; then echo "Problem while configure - Please check ${LOG}" exit 1 - else + else echo "Configure successful" fi echo "--------------------" @@ -253,17 +253,17 @@ function build() { echo "Please stand by..." make >> "${LOG}" 2>&1 if [ $? != 0 ]; - then + then echo "Problem while make - Please check ${LOG}" exit 1 else echo "Make Successful for ${IOS_ARCH}" fi - unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN OSFLAGS + unset POCO_TARGET_OSARCH IPHONE_SDK_VERSION_MIN OSFLAGS unset CROSS_TOP CROSS_SDK BUILD_TOOLS echo "--------------------" - + done cd lib/iPhoneOS @@ -287,7 +287,7 @@ function build() { for TOBESTRIPPED in $( ls -1) ; do strip -x $TOBESTRIPPED >> "${SLOG}" 2>&1 if [ $? != 0 ]; - then + then echo "Problem while stripping lib - Please check ${SLOG}" exit 1 else @@ -297,7 +297,7 @@ function build() { cd ../../ - + echo "--------------------" echo "Reseting changed files back to originals" cd build/config @@ -312,7 +312,7 @@ function build() { elif [ "$TYPE" == "android" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" - + local OLD_PATH=$PATH export PATH=$PATH:$BUILD_DIR/Toolchains/Android/androideabi/bin:$BUILD_DIR/Toolchains/Android/x86/bin @@ -380,7 +380,7 @@ function build() { make # delete debug builds rm lib/Linux/armv7l/*d.a - else + else echoWarning "TODO: build $TYPE lib" fi } @@ -405,7 +405,7 @@ function copy() { cp -Rv Zip/include/Poco/Zip $1/include/Poco # libs - if [ "$TYPE" == "osx" ] ; then + if [ "$TYPE" == "osx" ] ; then mkdir -p $1/lib/$TYPE cp -v lib/Darwin/*.a $1/lib/$TYPE elif [ "$TYPE" == "ios" ] ; then From aa1758ad92bbdbe63330e7dece4d3223e04a7b23 Mon Sep 17 00:00:00 2001 From: Daniel Rosser Date: Tue, 7 Oct 2014 17:29:33 +1100 Subject: [PATCH 28/34] Poco Formula Update 1.3 (cherry picked from commit 6530c521c3297684958b90f206f8522f8e2481c1) --- scripts/apothecary/formulas/poco/poco.sh | 35 +++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index e05dd06dbf8..d94a8566216 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -53,11 +53,11 @@ function prepare() { # fix using sed i636 reference and allow overloading variable sed -i .tmp "s|POCO_TARGET_OSARCH.* = .*|POCO_TARGET_OSARCH ?= i386|" iPhoneSimulator-clang-libc++ sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhoneSimulator-clang-libc++ - sed -i .tmp "s|STATICOPT_CC =|STATICOPT_CC ?= -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ - sed -i .tmp "s|STATICOPT_CXX =|STATICOPT_CXX ?= -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|STATICOPT_CC =|STATICOPT_CC ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|STATICOPT_CXX =|STATICOPT_CXX ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhone-clang-libc++ - sed -i .tmp "s|RELEASEOPT_CC = -DNDEBUG -O2|RELEASEOPT_CC = -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ - sed -i .tmp "s|RELEASEOPT_CXX = -DNDEBUG -O |RELEASEOPT_CXX = -DNDEBUG -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CC = -DNDEBUG -O2|RELEASEOPT_CC = -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CXX = -DNDEBUG -O |RELEASEOPT_CXX = -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ cd ../rules/ cp compile compile.orig @@ -72,7 +72,7 @@ function prepare() { fi # Locate the path of the openssl libs distributed with openFrameworks. - local OF_LIBS_OPENSSL="../../../../libs/openssl/" + local OF_LIBS_OPENSSL="$LIBS_DIR/openssl/" # get the absolute path to the included openssl libs local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) @@ -98,7 +98,7 @@ function prepare() { function build() { if [ "$TYPE" == "osx" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static -DHPDF_NOPNGLIB --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" # 32 bit # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. @@ -106,7 +106,7 @@ function build() { make # 64 bit - ./configure $BUILD_OPTS --config=Darwin64-clang-libc++ + ./configure $BUILD_OPTS -DPOCO_ENABLE_CPP11 --config=Darwin64-clang-libc++ make cd lib/Darwin @@ -130,8 +130,14 @@ function build() { elif [ "$TYPE" == "win_cb" ] ; then local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" - local OPENSSL_INCLUDE="/c/Users/bakercp/openFrameworks/libs/openssl/include" - local OPENSSL_LIBS="/c/Users/bakercp/openFrameworks/libs/openssl/lib/win_cb" + # Locate the path of the openssl libs distributed with openFrameworks. + local OF_LIBS_OPENSSL="$LIBS_DIR/openssl/" + + # get the absolute path to the included openssl libs + local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) + + local OPENSSL_INCLUDE=$OF_LIBS_OPENSSL_ABS_PATH/include + local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/win_cb ./configure $BUILD_OPTS \ --include-path=$OPENSSL_INCLUDE \ @@ -181,7 +187,7 @@ function build() { local BUILD_POCO_CONFIG_SIMULATOR=iPhoneSimulator-clang-libc++ # Locate the path of the openssl libs distributed with openFrameworks. - local OF_LIBS_OPENSSL="../../../../libs/openssl/" + local OF_LIBS_OPENSSL="$LIBS_DIR/openssl/" # get the absolute path to the included openssl libs local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) @@ -193,6 +199,7 @@ function build() { STATICOPT_CC=-fPIC STATICOPT_CXX=-fPIC + export HPDF_NOPNGLIB=1 # loop through architectures! yay for loops! for IOS_ARCH in ${IOS_ARCHS} @@ -230,9 +237,9 @@ function build() { if [[ "${IOS_ARCH}" == "i386" || "${IOS_ARCH}" == "x86_64" ]]; then - export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" else - export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" fi echo "--------------------" echo "Making Poco-${VER} for ${PLATFORM} ${SDKVERSION} ${IOS_ARCH} : iOS Minimum=$MIN_IOS_VERSION" @@ -266,6 +273,8 @@ function build() { done + unset HPDF_NOPNGLIB + cd lib/iPhoneOS # link into universal lib, strip "lib" from filename local lib @@ -317,7 +326,7 @@ function build() { export PATH=$PATH:$BUILD_DIR/Toolchains/Android/androideabi/bin:$BUILD_DIR/Toolchains/Android/x86/bin - local OF_LIBS_OPENSSL="../../../../libs/openssl/" + local OF_LIBS_OPENSSL="$LIBS_DIR/openssl/" # get the absolute path to the included openssl libs local OF_LIBS_OPENSSL_ABS_PATH=$(cd $(dirname $OF_LIBS_OPENSSL); pwd)/$(basename $OF_LIBS_OPENSSL) From c6f486f5271f0bf726a12ba2cfefef7ee1d175e7 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 7 Oct 2014 10:38:34 -0500 Subject: [PATCH 29/34] Remove Poco::PDF (cherry picked from commit e36f5b518893416101833ba87544340e1fdaadfd) --- scripts/apothecary/formulas/poco/poco.sh | 41 ++++++++++++------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index d94a8566216..afcd29e65fd 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -53,11 +53,11 @@ function prepare() { # fix using sed i636 reference and allow overloading variable sed -i .tmp "s|POCO_TARGET_OSARCH.* = .*|POCO_TARGET_OSARCH ?= i386|" iPhoneSimulator-clang-libc++ sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhoneSimulator-clang-libc++ - sed -i .tmp "s|STATICOPT_CC =|STATICOPT_CC ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ - sed -i .tmp "s|STATICOPT_CXX =|STATICOPT_CXX ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|STATICOPT_CC =|STATICOPT_CC ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|STATICOPT_CXX =|STATICOPT_CXX ?= -DNDEBUG -DPOCO_ENABLE_CPP11 -Os -fPIC|" iPhone-clang-libc++ sed -i .tmp "s|OSFLAGS = -arch|OSFLAGS ?= -arch|" iPhone-clang-libc++ - sed -i .tmp "s|RELEASEOPT_CC = -DNDEBUG -O2|RELEASEOPT_CC = -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ - sed -i .tmp "s|RELEASEOPT_CXX = -DNDEBUG -O |RELEASEOPT_CXX = -DNDEBUG -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CC = -DNDEBUG -O2|RELEASEOPT_CC = -DNDEBUG -DPOCO_ENABLE_CPP11 -Os -fPIC|" iPhone-clang-libc++ + sed -i .tmp "s|RELEASEOPT_CXX = -DNDEBUG -O |RELEASEOPT_CXX = -DNDEBUG -DPOCO_ENABLE_CPP11 -Os -fPIC|" iPhone-clang-libc++ cd ../rules/ cp compile compile.orig @@ -98,7 +98,7 @@ function prepare() { function build() { if [ "$TYPE" == "osx" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static -DHPDF_NOPNGLIB --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" # 32 bit # For OS 10.9+ we must explicitly set libstdc++ for the 32-bit OSX build. @@ -106,9 +106,14 @@ function build() { make # 64 bit - ./configure $BUILD_OPTS -DPOCO_ENABLE_CPP11 --config=Darwin64-clang-libc++ + + export POCO_ENABLE_CPP11=1 + + ./configure $BUILD_OPTS --config=Darwin64-clang-libc++ make + unset POCO_ENABLE_CPP11 + cd lib/Darwin # delete debug builds @@ -128,7 +133,7 @@ function build() { cmd //c buildwin.cmd ${VS_VER}0 build static_md both Win32 nosamples notests elif [ "$TYPE" == "win_cb" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" # Locate the path of the openssl libs distributed with openFrameworks. local OF_LIBS_OPENSSL="$LIBS_DIR/openssl/" @@ -195,11 +200,10 @@ function build() { local OPENSSL_INCLUDE=$OF_LIBS_OPENSSL_ABS_PATH/include local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ios - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen --include-path=$OPENSSL_INCLUDE --library-path=$OPENSSL_LIBS" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen --include-path=$OPENSSL_INCLUDE --library-path=$OPENSSL_LIBS" STATICOPT_CC=-fPIC STATICOPT_CXX=-fPIC - export HPDF_NOPNGLIB=1 # loop through architectures! yay for loops! for IOS_ARCH in ${IOS_ARCHS} @@ -237,9 +241,9 @@ function build() { if [[ "${IOS_ARCH}" == "i386" || "${IOS_ARCH}" == "x86_64" ]]; then - export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" else - export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -DHPDF_NOPNGLIB -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" + export OSFLAGS="-arch $POCO_TARGET_OSARCH -fPIC -DPOCO_ENABLE_CPP11 -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} $MIN_TYPE$IPHONE_SDK_VERSION_MIN" fi echo "--------------------" echo "Making Poco-${VER} for ${PLATFORM} ${SDKVERSION} ${IOS_ARCH} : iOS Minimum=$MIN_IOS_VERSION" @@ -273,8 +277,6 @@ function build() { done - unset HPDF_NOPNGLIB - cd lib/iPhoneOS # link into universal lib, strip "lib" from filename local lib @@ -320,7 +322,7 @@ function build() { echo "Completed." elif [ "$TYPE" == "android" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" local OLD_PATH=$PATH @@ -334,7 +336,7 @@ function build() { local OPENSSL_INCLUDE=$OF_LIBS_OPENSSL_ABS_PATH/include local OPENSSL_LIBS=$OF_LIBS_OPENSSL_ABS_PATH/lib/ - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" ./configure $BUILD_OPTS \ --include-path=$OPENSSL_INCLUDE \ @@ -366,25 +368,25 @@ function build() { export PATH=$OLD_PATH elif [ "$TYPE" == "linux" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/$(uname -m)/*d.a elif [ "$TYPE" == "linux64" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/x86_64/*d.a elif [ "$TYPE" == "linuxarmv6l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds rm lib/Linux/armv6l/*d.a elif [ "$TYPE" == "linuxarmv7l" ] ; then - local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PocoDoc,ProGen" + local BUILD_OPTS="--no-tests --no-samples --static --omit=CppUnit,CppUnit/WinTestRunner,Data/MySQL,Data/ODBC,PageCompiler,PageCompiler/File2Page,CppParser,PDF,PocoDoc,ProGen" ./configure $BUILD_OPTS make # delete debug builds @@ -407,7 +409,6 @@ function copy() { cp -Rv MongoDB/include/Poco/MongoDB $1/include/Poco cp -Rv Net/include/Poco/Net $1/include/Poco cp -Rv NetSSL_OpenSSL/include/Poco/Net/* $1/include/Poco/Net - cp -Rv PDF/include/Poco/PDF $1/include/Poco cp -Rv SevenZip/include/Poco/SevenZip $1/include/Poco cp -Rv Util/include/Poco/Util $1/include/Poco cp -Rv XML/include/Poco/* $1/include/Poco From bd2e7da8c243148fe89c8ec1fc707678abae3f2c Mon Sep 17 00:00:00 2001 From: Daniel Rosser Date: Tue, 25 Nov 2014 02:47:10 +1100 Subject: [PATCH 30/34] Apothecary Formula - iOS Update for Poco - Removed armv7s (cherry picked from commit ae730a006e0068a197030c73c913d388a69315d3) --- scripts/apothecary/formulas/poco/poco.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index afcd29e65fd..255e43a847b 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -165,7 +165,7 @@ function build() { TOOLCHAIN=${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain VERSION=$VER - local IOS_ARCHS="i386 x86_64 armv7 armv7s arm64" + local IOS_ARCHS="i386 x86_64 armv7 arm64" echo "--------------------" echo $CURRENTPATH @@ -283,7 +283,7 @@ function build() { for lib in $( ls -1 i386) ; do local renamedLib=$(echo $lib | sed 's|lib||') if [ ! -e $renamedLib ] ; then - lipo -c armv7/$lib armv7s/$lib arm64/$lib i386/$lib x86_64/$lib -o ../ios/$renamedLib + lipo -c armv7/$lib arm64/$lib i386/$lib x86_64/$lib -o ../ios/$renamedLib fi done From 149da18168b284b257da2ebeab539390eee0de8e Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 24 Nov 2014 23:02:53 -0600 Subject: [PATCH 31/34] Update apothecary-poco tag to 1.7. (cherry picked from commit 0e71b0470016813ce15d415a1b43c59294a425a9) --- scripts/apothecary/formulas/poco/poco.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/poco/poco.sh b/scripts/apothecary/formulas/poco/poco.sh index 255e43a847b..ee9840f6ac2 100644 --- a/scripts/apothecary/formulas/poco/poco.sh +++ b/scripts/apothecary/formulas/poco/poco.sh @@ -8,7 +8,7 @@ # specify specfic build configs in poco/config using ./configure --config=NAME # define the version -VER=apothecary-1.5 +VER=apothecary-1.7 # tools for git use GIT_URL=https://github.com/bakercp/poco From da1844f008f677b05103b328f2c032c66459e458 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 29 Jul 2014 14:51:08 -0500 Subject: [PATCH 32/34] Alternative to manual #undef verify trick for Poco. - Defines macros w/ underscore. - This is default behavior in OSX 10.9+ in AssertMacros.h (cherry picked from commit 50c52f371460bea5ca95cdeb3a4687bc0d9003db) --- libs/openFrameworks/utils/ofConstants.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 21c8a902432..f69b3f70da2 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -59,7 +59,8 @@ enum ofTargetPlatform{ #if defined( __WIN32__ ) || defined( _WIN32 ) #define TARGET_WIN32 #elif defined( __APPLE_CC__) - #include + #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 + #include #if (TARGET_OS_IPHONE_SIMULATOR) || (TARGET_OS_IPHONE) || (TARGET_IPHONE) #define TARGET_OF_IPHONE From a9da5c54af0799cdbdb82c8b9db5884cd01b4553 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Mon, 24 Nov 2014 15:09:17 -0600 Subject: [PATCH 33/34] Remove duplicate copy phase for osx. (cherry picked from commit df7b2bc03f762a4cdd6f05ecace36655e7c543b5) --- scripts/apothecary/formulas/openssl.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/apothecary/formulas/openssl.sh b/scripts/apothecary/formulas/openssl.sh index e900288fdc2..900028d9664 100644 --- a/scripts/apothecary/formulas/openssl.sh +++ b/scripts/apothecary/formulas/openssl.sh @@ -507,20 +507,17 @@ function copy() { # storing a copy of the include in lib/include/ # set via: cp -R "build/$TYPE/x86_64/include/" "lib/include/" - rm -r $1/lib/$TYPE/* + # suppress file not found errors + rm -rf $1/lib/$TYPE/* 2> /dev/null # libs if [ "$TYPE" == "osx" ] ; then - echoWarning "TODO: copy $TYPE lib" - # mkdir -p $1/lib/$TYPE - # cp -v lib/Darwin/*.a $1/lib/$TYPE + mkdir -p $1/lib/$TYPE + cp -v lib/$TYPE/*.a $1/lib/$TYPE elif [ "$TYPE" == "ios" ] ; then cp -Rv lib/include/ $1/include/ mkdir -p $1/lib/$TYPE cp -v lib/$TYPE/*.a $1/lib/$TYPE - elif [ "$TYPE" == "osx" ] ; then - mkdir -p $1/lib/$TYPE - cp -v lib/$TYPE/*.a $1/lib/$TYPE # elif [ "$TYPE" == "vs" ] ; then # mkdir -p $1/lib/$TYPE # cp -v lib/*.lib $1/lib/$TYPE From 4c3b062c26502d2ccdda7714cca4c09afe4392aa Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Tue, 25 Nov 2014 01:36:24 -0600 Subject: [PATCH 34/34] Added missing copy command. (cherry picked from commit 35e2f681508f95ad35b2beb83fddb0519396785f) --- scripts/apothecary/formulas/openssl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/apothecary/formulas/openssl.sh b/scripts/apothecary/formulas/openssl.sh index 900028d9664..d2f39499916 100644 --- a/scripts/apothecary/formulas/openssl.sh +++ b/scripts/apothecary/formulas/openssl.sh @@ -511,7 +511,8 @@ function copy() { rm -rf $1/lib/$TYPE/* 2> /dev/null # libs - if [ "$TYPE" == "osx" ] ; then + if [ "$TYPE" == "osx" ] ; then + cp -Rv lib/include/ $1/include/ mkdir -p $1/lib/$TYPE cp -v lib/$TYPE/*.a $1/lib/$TYPE elif [ "$TYPE" == "ios" ] ; then