Opened 5 years ago

Closed 5 years ago

#59838 closed defect (fixed)

Webkit2-gtk @2.26.2_0+minibrowser+x11 JSCore Compilation

Reported by: jmercouris (John Mercouris) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: kencu (Ken)
Port: webkit2-gtk

Description

I'm not able to compile a program using WebKitGTK+ without doing the steps reproduced below.

I had the following error on compilation:

In file included from /opt/local/include/webkitgtk-4.0/JavaScriptCore/JSObjectRef.h:31:
/opt/local/include/webkitgtk-4.0/JavaScriptCore/JSValueRef.h:54:18: error: missing ',' between enumerators
    kJSTypeSymbol JSC_API_AVAILABLE(macos(10.15), ios(13.0))

Investigating a little bit more I see a file /opt/local/include/webkitgtk-4.0/JavaScriptCore/WebKitAvailability.h

in which the symbol JSC_API_AVAILABLE is defined. That file is reproduced below for convenience:

/*
 * Copyright (C) 2008, 2009, 2010, 2014 Apple Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef __WebKitAvailability__
#define __WebKitAvailability__

#if defined(__APPLE__)

#include <AvailabilityMacros.h>
#include <CoreFoundation/CoreFoundation.h>

#if defined(BUILDING_GTK__)
#undef JSC_API_AVAILABLE
#define JSC_API_AVAILABLE(...)
#endif

#else
#define JSC_API_AVAILABLE(...)
#endif

#endif /* __WebKitAvailability__ */

I had to change it like this to get anything to compile with WebKitGTK+, basically so that the symbol is defined.

#ifndef __WebKitAvailability__
#define __WebKitAvailability__

#if defined(__APPLE__)

#include <AvailabilityMacros.h>
#include <CoreFoundation/CoreFoundation.h>

#define JSC_API_AVAILABLE(...)
#endif

#endif /* __WebKitAvailability__ */

Not sure if this is a known issue or if I am possibly not setting some environment variable in my compilation. In any case, I figured I would make this report. Please note that this problem should also effect webkit2-gtk-devel.

Thank you for your time!

Change History (5)

comment:1 Changed 5 years ago by kencu (Ken)

known issue. we set that define BUILDING_GTK__ in every port that uses webkit2-gtk.

I would personally maybe patch the header when we install it, but that's not the MacPorts way to do things.

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:2 Changed 5 years ago by jmercouris (John Mercouris)

So what would the fix be then? Defining the symbol BUILDING_GTK__ in any project you wish to build against WebKit2GTK? If so, I think it should perhaps be in the port information printed after installation.

Last edited 5 years ago by jmercouris (John Mercouris) (previous) (diff)

comment:3 Changed 5 years ago by mf2k (Frank Schima)

Cc: dbevans removed
Owner: set to dbevans
Status: newassigned

comment:4 Changed 5 years ago by kencu (Ken)

That is the requirement, yes, to use webkit2-gtk on Apple OS versions. It's Apple's product, they wrote it that way, and it's their requirement, so I guess it's totally an upstream decision.

It took me a little bit of time to find that point out as well, a couple of years ago, so I don't have an issue with adding a bit to the port notes.

comment:5 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 8519fab8917360b6d625cb07421f91d1f9803ab9/macports-ports (master):

webkit2-gtk-*: add porting note for new users

closes: #59838

Note: See TracTickets for help on using tickets.