Attempt to fix jsonb_plpython build on Windows
authorPeter Eisentraut
Wed, 28 Mar 2018 15:49:23 +0000 (11:49 -0400)
committerPeter Eisentraut
Wed, 28 Mar 2018 15:49:23 +0000 (11:49 -0400)
src/tools/msvc/Install.pm
src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/vcregress.pl

index d8ef98e4f7afd633e0bbe9a5c9f601272d55de12..8f3cc173c5b72d36c06cee754d48f3fc86ccbb05 100644 (file)
@@ -465,6 +465,7 @@ sub CopyContribFiles
            next if ($d eq "xml2"            && !defined($config->{xml}));
            next if ($d eq "hstore_plperl"   && !defined($config->{perl}));
            next if ($d eq "hstore_plpython" && !defined($config->{python}));
+           next if ($d eq "jsonb_plpython"  && !defined($config->{python}));
            next if ($d eq "ltree_plpython"  && !defined($config->{python}));
            next if ($d eq "sepgsql");
 
index 5762c68c4e2ccd4990acaa13a971ad7a051647c1..f3ec75f874e82e9e6140984d0342136c98b36a6c 100644 (file)
@@ -43,6 +43,7 @@ my $contrib_extrasource = {
 my @contrib_excludes = (
    'commit_ts',       'hstore_plperl',
    'hstore_plpython', 'intagg',
+   'jsonb_plpython',
    'ltree_plpython',  'pgcrypto',
    'sepgsql',         'brin',
    'test_extensions', 'test_pg_dump',
@@ -506,6 +507,11 @@ sub mkvcbuild
            'hstore',                        'contrib/hstore');
        $hstore_plpython->AddDefine(
            'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
+       my $jsonb_plpython = AddTransformModule(
+           'jsonb_plpython' . $pymajorver, 'contrib/jsonb_plpython',
+           'plpython' . $pymajorver,       'src/pl/plpython');
+       $jsonb_plpython->AddDefine(
+           'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
        my $ltree_plpython = AddTransformModule(
            'ltree_plpython' . $pymajorver, 'contrib/ltree_plpython',
            'plpython' . $pymajorver,       'src/pl/plpython',
@@ -850,20 +856,23 @@ sub AddTransformModule
    my $n_src          = shift;
    my $pl_proj_name   = shift;
    my $pl_src         = shift;
-   my $transform_name = shift;
-   my $transform_src  = shift;
+   my $type_name      = shift;
+   my $type_src       = shift;
 
-   my $transform_proj = undef;
-   foreach my $proj (@{ $solution->{projects}->{'contrib'} })
+   my $type_proj = undef;
+   if ($type_name)
    {
-       if ($proj->{name} eq $transform_name)
+       foreach my $proj (@{ $solution->{projects}->{'contrib'} })
        {
-           $transform_proj = $proj;
-           last;
+           if ($proj->{name} eq $type_name)
+           {
+               $type_proj = $proj;
+               last;
+           }
        }
+       die "could not find base module $type_name for transform module $n"
+         if (!defined($type_proj));
    }
-   die "could not find base module $transform_name for transform module $n"
-     if (!defined($transform_proj));
 
    my $pl_proj = undef;
    foreach my $proj (@{ $solution->{projects}->{'PLs'} })
@@ -894,13 +903,16 @@ sub AddTransformModule
    }
 
    # Add base module dependencies
-   $p->AddIncludeDir($transform_src);
-   $p->AddIncludeDir($transform_proj->{includes});
-   foreach my $trans_lib (@{ $transform_proj->{libraries} })
+   if ($type_proj)
    {
-       $p->AddLibrary($trans_lib);
+       $p->AddIncludeDir($type_src);
+       $p->AddIncludeDir($type_proj->{includes});
+       foreach my $type_lib (@{ $type_proj->{libraries} })
+       {
+           $p->AddLibrary($type_lib);
+       }
+       $p->AddReference($type_proj);
    }
-   $p->AddReference($transform_proj);
 
    return $p;
 }
index 314f2c37d2b6e81ec2a40e0a659da01f08c4b408..bac218c016c6d7fb365f52f0f8f12578c45257e0 100644 (file)
@@ -326,6 +326,7 @@ sub subdircheck
    # Makefile for more details regarding Python-version specific
    # dependencies.
    if (   $module eq "hstore_plpython"
+       || $module eq "jsonb_plpython"
        || $module eq "ltree_plpython")
    {
        die "Python not enabled in configuration"
@@ -376,6 +377,7 @@ sub contribcheck
        next if ($module eq "xml2"          && !defined($config->{xml}));
        next if ($module eq "hstore_plperl" && !defined($config->{perl}));
        next if ($module eq "hstore_plpython" && !defined($config->{python}));
+       next if ($module eq "jsonb_plpython"  && !defined($config->{python}));
        next if ($module eq "ltree_plpython"  && !defined($config->{python}));
        next if ($module eq "sepgsql");